Reputation: 424
I have the below code with a list as:
def l = ['a','e','A','x','Z','p','Q']
println(l.sort())
Which generates output as:
[A, Q, Z, a, e, p, x]
Now, I know that this is ASCII based sorting, I just want to get the correct result. What are the possible solutions for this situation? What I want is something like:
[A, a, e, p, Q, x, Z]
Upvotes: 0
Views: 78