java newbie... sort array
How do I sort an array of "-" delimited numbers?
The array will contain numbers like this:
Any clue on how I can sort that?
nevermind... I'm real new w/ java...
one option is to read the numbers like string and remove "-" from it and convert it back to numbers and sort (like ordinary numbers).
The other option if format is fixed for all numbers is to look at the first part of the number and compare i.e if the numbers are
Then comapring the first digit (0 & 1) yields the order regardless of the remaining digits. If the first digit is same then go to the second one and so on till order is sorted out but beware if the format is not fixed then it will not work e.g
in this case since the format is different the second number though bigger may end up as a smaller number in comparison.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center