com.seejoke.core.utils.StringUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-tools Show documentation
Show all versions of core-tools Show documentation
提供java常用的、流行的工具方法,减少项目冗余代码
package com.seejoke.core.utils;
import java.util.HashSet;
/**
* string常用工具类
*
* @author yangzhongying
* @version 1.0
**/
public class StringUtils extends org.apache.commons.lang3.StringUtils {
public static String[] distinct(String[] arr) {
if (arr == null || arr.length == 0) {
return arr;
}
HashSet set = new HashSet<>();
for (String str : arr) {
set.add(str);
}
return set.toArray(new String[0]);
}
}