I think this may be a duplicate question. But couldn’t find the answer for my requirement.
I have a list of names (String) such as
Merill, Gopi, kamal, orange, white
I need to do something to get the list in ascending order using collections like the following
Gopi, kamal, Merill, orange, white
Is it possible to get the list in alphabeticalorder?
Can anyone please tell how to sort this using collections?
(Please provide a solution before closing this questiona as duplicate)
I know your trying to sort it using Collections, but here’s a simple way:
And this is outputted:
The array is sorted numerical/other first, then capital-alphabetical, then lowercase-alphabetical