fork download
  1. import java.util.*;
  2.  
  3. class Example {
  4. public static void main(String[] args) {
  5. String [] str = new String[]{"1some", "2some", "20some", "21some", "3some", "some"};
  6. List<String> list = Arrays.asList(str);
  7.  
  8. Collections.sort(list, String.CASE_INSENSITIVE_ORDER);
  9. System.out.println(list);
  10. }
  11. }
Success #stdin #stdout 0.06s 27880KB
stdin
Standard input is empty
stdout
[1some, 20some, 21some, 2some, 3some, some]