1 public static String[] array_unique(String[] a) { 2 Set<String> set = new HashSet<String>(); 3 set.addAll(Arrays.asList(a)); 4 return set.toArray(new String[0]); 5 }
1 public static String[] array_unique(String[] a) { 2 Set<String> set = new HashSet<String>(); 3 set.addAll(Arrays.asList(a)); 4 return set.toArray(new String[0]); 5 }
转载于:https://www.cnblogs.com/a198720/p/3895110.html