How do I sort an ArrayList lexicographically?

Posted by Jake on Stack Overflow See other posts from Stack Overflow or by Jake
Published on 2010-06-08T16:09:43Z Indexed on 2010/06/08 16:12 UTC
Read the original article Hit count: 288

Filed under:
|
|
|
|

I am trying to sort an ArrayList of Strings that represent card values. So, some cards contain letters ("King") and some contain Strings containing only a number ("7"). I know to use Collections.sort, but it only sorts Strings that contain letters. How do I get the ArrayList to be sorted by number as well as alphabetically?

© Stack Overflow or respective owner

Related posts about java

Related posts about string