📅  最后修改于: 2022-03-11 14:52:41.248000             🧑  作者: Mango
String str2 = "ABABABCDEF";// ABCDEF
String[] arr2 = str2.split("");
str2 = new LinkedHashSet<>(Arrays.asList(arr2)).toString().replace(", ", "");
System.out.println(str2); // ABCDEF