Commit b17fa572 authored by yanzg's avatar yanzg

数组判断

parent e349b473
......@@ -833,6 +833,40 @@ public class StringHelper {
}
}
/***
* 判断是否在数组中
* @return
*/
public static boolean isIn(int from, int... tos) {
for (int to : tos) {
if (from == to) {
return true;
}
}
return false;
}
/***
* 判断是否在数组中
* @return
*/
public static boolean isIn(String from, String... tos) {
return isIn(false, from, tos);
}
/***
* 判断是否在数组中
* @return
*/
public static boolean isIn(boolean ignoreCase, String from, String... tos) {
for (String to : tos) {
if (StringHelper.compare(from, to, ignoreCase)) {
return true;
}
}
return false;
}
/**
* 获取UUID
......
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