Link to home
Start Free TrialLog in
Avatar of ScarletBlue
ScarletBlue

asked on

Sorting String[] with strings starting with capital letter and strings in lowercase

Hi
Just as the title says..im trying to sort an array of strings. An example code follows :

String[] x = {"smithaj", "VMerve","albertd"};
Arrays.sort(x);

The output I get from this would be:
VMerve
albertd
smithaj

It sorts the strings starting with capital letters first.. The result I want is:
albertd
smithaj
VMerve

I donot want to change the way the data is ie. change all strings to lowercase/uppercase.
Is there a way it will sort the data with ignoring the case?

Thank you in adavance.
SB
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)