java - Sort arraylist of letters and numbers -
this question has answer here:
i'm trying sort arraylist of strings made of numbers , letters, example of list once sorted be:
name 1 name 2 name 3 name 11 name 12 name 13
but when use collections.sort() sorts way:
name 1 name 11 name 12 name 13 name 2 name 3
any ideas type of sort i'm looking called or how it?
string
s ordered alphabetically default. need implement own comparator<string>
or use object implements comparable
(or use comparator
it) solve this, since string
s using mixtures of words , integers.
Comments
Post a Comment