I have a method that returns a String list to be sorted. However, I ran into the problem of sorting old strings and wondered if anyone could help implement the Comparator or point me in the direction of one.
The list will return something list:
State Lower Legislative District 1 State Lower Legislative District 11 State Lower Legislative District 12 ... State Lower Legislative District 2 ... State Lower Legislative District 100 ... State Upper Legislative District 1 State Upper Legislative District 11 ...
So, first I need to do a basic String sort, but then I need to sort by number. The sort number should always be tracked and may be 2 or 3 digits.
(Edit). My initial thought is to split the string into a space, run StringUtils.isNumeric into parts of a number, and then sort. However, it seems to me that this is a little for me.
Can anyone help?
Jason
source share