You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
weaver-hrm-organization/src/com/engine/shgw/Util/CommUtils.java

30 lines
643 B
Java

package com.engine.shgw.Util;
import java.util.HashSet;
import java.util.Set;
/**
* 工具类
*
* @author wangj
* @version 1.00版本
* @Date 2024/5/13
*/
public class CommUtils {
/**
* @Description:字符串去重
* @Author: wangj
*/
public static String distinctStringWithDot(String str) {
String[] strArr = str.split(",");
Set set = new HashSet();
for (int i = 0; i < strArr.length; i++) {
if ("".equals(strArr[i])) {continue;}
set.add(strArr[i]);
}
strArr = (String[]) set.toArray(new String[0]);
return String.join(",", strArr);
}
}