mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
StrUtil添加subBetweenAll()方法
This commit is contained in:
@@ -3,7 +3,6 @@ package cn.hutool.core.lang;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
|
||||
/**
|
||||
@@ -57,4 +56,5 @@ public class ConsoleTest {
|
||||
ThreadUtil.sleep(200);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -421,5 +421,11 @@ public class StrUtilTest {
|
||||
Assert.assertEquals("1AB", StrUtil.padAfter("1", 3, "ABC"));
|
||||
Assert.assertEquals("23", StrUtil.padAfter("123", 2, "ABC"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void subBetweenAllTest() {
|
||||
Assert.assertArrayEquals(new String[]{"yz","abc"},StrUtil.subBetweenAll("saho[yz]fdsadp[abc]a","\\[","\\]"));
|
||||
Assert.assertArrayEquals(new String[]{"abc"}, StrUtil.subBetweenAll("saho[yzfdsadp[abc]a]","\\[","\\]"));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user