mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-10 06:09:12 +00:00
update 优化 工具类封装
This commit is contained in:
@@ -320,4 +320,21 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 不区分大小写检查 CharSequence 是否以指定的前缀开头。
|
||||
*
|
||||
* @param str 要检查的 CharSequence 可能为 null
|
||||
* @param prefixs 要查找的前缀可能为 null
|
||||
* @return 是否包含
|
||||
*/
|
||||
public static boolean startWithAnyIgnoreCase(CharSequence str, CharSequence... prefixs) {
|
||||
// 判断是否是以指定字符串开头
|
||||
for (CharSequence prefix : prefixs) {
|
||||
if (StringUtils.startsWithIgnoreCase(str, prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user