java 拼音排序
- 摘要:publicvoidtest_sort_pinyin(){Collatorcmp=Collator.getInstance(java.util.Locale.CHINA);String[]arr={"张三","李四","王五","赵六","JAVA","123","$%$#","哈哈A","1哈哈A","1哈哈b","1哈哈a","哈哈","哈","怡情"};List<String>list=Arrays.asList(arr);Arrays.sort(arr,cmp)
- 标签:Java
public void test_sort_pinyin() {
Collator cmp = Collator.getInstance(java.util.Locale.CHINA);
String[] arr = { "张三", "李四", "王五", "赵六", "JAVA", "123", "$%$#", "哈哈A",
"1哈哈A", "1哈哈b", "1哈哈a", "哈哈", "哈", "怡情" };
List<String> list = Arrays.asList(arr);
Arrays.sort(arr, cmp);
System.out.println(list);
}