Commit 218b4d59 by songxiang

增加工具类方法

parent 91518240
......@@ -613,7 +613,26 @@ public class StringTools {
* @param array
* @return
*/
public static boolean equalss(String str, String[] array) {
public static boolean equalss(String str, String... array) {
if (StringUtil.isEmpty(str) || array == null) {
return false;
}
for (String s : array) {
if (str.equals(s)) {
return true;
}
}
return false;
}
/**
* 判断字符是否在数组中存在。如果数组为null则返回false
*
* @param str
* @param array
* @return
*/
public static boolean equalss(String str, List<String> array) {
if (StringUtil.isEmpty(str) || array == null) {
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment