String fdbs = "WXB,WXA,FDA,WXB";
String[] str = fdbs.split(",");
Set set = new HashSet();
for (int i = 0; i < str.length; i++) {
set.add(str[i]);
}
str = (String[]) set.toArray(new String[0]);
for (int i = 0; i < str.length; i++) {
System.out.println(str[i]);
}
字符串数组去重
最新推荐文章于 2023-06-24 17:37:37 发布