I need to sort a List based on MyDto.name in client-side GWT code. Currently I am trying to do this...
Collections.sort(_myDtos, new Comparator<MyDto>() {
@Override
public int compare(MyDto o1, MyDto o2) {
return o1.getName().compareTo(o2.getName());
}
});
Unfortunately the sorting is not what I was expecting as anything in upper-case is before lower-case. For example ESP comes before aESP.
This is the bad boy you want: String.CASE_INSENSITIVE_ORDER
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With