int compareTo(String anotherString) Compares two strings lexicographically.
if you use this then it will return an int. Use this int to compare the string before it.
So if S1.compareTo(String S2) >0 then S1 is larger.
Alan Moore
Ranch Hand
Joined: May 06, 2004
Posts: 262
posted
0
You'll have to write your own comparator and pass it to the sort() method. In your comparator, you'll extract the digits before the dot, convert them to an int and compare them. Then, if necessary, do the same for the digits following the dot (if there aren't any, treat that as a zero).
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.