mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
修复ReUtil.delAll方法当 content 仅为空格时的问题
This commit is contained in:
parent
d4b5ab525d
commit
c3f378207b
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.8.13.M1 (2023-02-20)
|
# 5.8.13.M1 (2023-02-21)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
@ -11,6 +11,7 @@
|
|||||||
* 【core 】 修复法定年龄计算的BUG(pr#935@Gitee)
|
* 【core 】 修复法定年龄计算的BUG(pr#935@Gitee)
|
||||||
* 【core 】 修复FileUtil.rename报NoSuchFileException问题(pr#2894@Github)
|
* 【core 】 修复FileUtil.rename报NoSuchFileException问题(pr#2894@Github)
|
||||||
* 【core 】 修复StrUtil.split切分长度为0时的bug(pr#944@Gitee)
|
* 【core 】 修复StrUtil.split切分长度为0时的bug(pr#944@Gitee)
|
||||||
|
* 【core 】 修复ReUtil.delAll方法当 content 仅为空格时的问题(issue#I6GIMT@Gitee)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ public class ReUtil {
|
|||||||
* @return 删除后剩余的内容
|
* @return 删除后剩余的内容
|
||||||
*/
|
*/
|
||||||
public static String delAll(String regex, CharSequence content) {
|
public static String delAll(String regex, CharSequence content) {
|
||||||
if (StrUtil.hasBlank(regex, content)) {
|
if (StrUtil.hasEmpty(regex, content)) {
|
||||||
return StrUtil.str(content);
|
return StrUtil.str(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ public class ReUtil {
|
|||||||
* @return 删除后剩余的内容
|
* @return 删除后剩余的内容
|
||||||
*/
|
*/
|
||||||
public static String delAll(Pattern pattern, CharSequence content) {
|
public static String delAll(Pattern pattern, CharSequence content) {
|
||||||
if (null == pattern || StrUtil.isBlank(content)) {
|
if (null == pattern || StrUtil.isEmpty(content)) {
|
||||||
return StrUtil.str(content);
|
return StrUtil.str(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,4 +210,9 @@ public class ReUtilTest {
|
|||||||
final String s = ReUtil.replaceAll("1.2.3.4", patternIp, "$1.**.**.$10");
|
final String s = ReUtil.replaceAll("1.2.3.4", patternIp, "$1.**.**.$10");
|
||||||
Assert.assertEquals("1.**.**.4", s);
|
Assert.assertEquals("1.**.**.4", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void issueI6GIMTTest(){
|
||||||
|
Assert.assertEquals(StrUtil.EMPTY, ReUtil.delAll("[\\s]*", " "));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user