Sorting an array with strings having chars and number combinations | Selenium Forum
S
sehjad Posted on 24/06/2020

How do we sort an arraylist(string) like:

X= auto1000,auto2000,auto3000,auto5555,auto6000-xyz

 

I have used Collections.sort() but its giving weired result.

 

Kindly help.

 


A
Ashish Replied on 25/06/2020

If the initial string i same(autom)

then you sort  this out by extracting number from every element


A
Ashish Replied on 25/06/2020

If the initial string i same(autom)

then you sort  this out by extracting number from every element


Related Posts