mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
db support remarks etc propertis
This commit is contained in:
@@ -965,6 +965,25 @@ public class StrUtil {
|
||||
return str.toString().replace(strToRemove, EMPTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除字符串中所有给定字符串,当某个字符串出现多次,则全部移除<br>
|
||||
* 例:removeAny("aa-bb-cc-dd", "a", "b") =》 --cc-dd
|
||||
*
|
||||
* @param str 字符串
|
||||
* @param strsToRemove 被移除的字符串
|
||||
* @return 移除后的字符串
|
||||
* @since 5.3.8
|
||||
*/
|
||||
public static String removeAny(CharSequence str, CharSequence... strsToRemove) {
|
||||
String result = str(str);
|
||||
if (isNotEmpty(str)) {
|
||||
for (CharSequence strToRemove : strsToRemove) {
|
||||
result = removeAll(str, strToRemove);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除字符串中指定的多个字符,如有多个则全部去除
|
||||
*
|
||||
|
Reference in New Issue
Block a user