public class sortByPinyin { public static void main(String[] args) { String[] arr = { "刘刘", "李飞", "王五", "老三", "贝贝", "啊三" }; Collator cmp = Collator.getInstance(java.util.Locale.CHINA); Arrays.sort(arr, cmp); List<String> list = Arrays.asList(arr); System.out.println(list); } }
原文地址:https://www.cnblogs.com/duanqiao123/p/9130958.html
时间: 2024-10-09 20:07:25