String[] myArray = {"Player 30","Player2 35"};
This statement
Arrays.sort(scoreArray);
will sort myArray by Letters.
Output:
aPlayer 30
bPlayer 35
Problem: Is there a way to sort myArray by numbers from highest to lowest?
The output should be:
bPlayer 35
aPlayer 30
I even tried foolish things like.
String[] myArray = {"30 Player","35 Player2 "};
by sorting this using
Arrays.sort
and reverse it so it will output
35 Player2
30 Player
But if myArray contains this Element 9 Player it will be the first output. I know this sucks hehe trying to fool.
Back to the original problem.
Help is much appreciated thank you.