java 拼音排序_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > java 拼音排序

java 拼音排序

 2015/5/5 16:04:28  guanrain  程序员俱乐部  我要评论(0)
  • 摘要: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);
}
上一篇: java 动态缓存 下一篇: 类加载器
发表评论
用户名: 匿名