mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-05 13:17:58 +08:00
add test
This commit is contained in:
parent
0c6bd4e7dc
commit
c138eb5028
@ -2709,7 +2709,6 @@ public class StrUtil {
|
||||
|
||||
/**
|
||||
* 有序的格式化文本,使用{number}做为占位符<br>
|
||||
* 例:<br>
|
||||
* 通常使用:format("this is {0} for {1}", "a", "b") =》 this is a for b<br>
|
||||
*
|
||||
* @param pattern 文本格式
|
||||
|
@ -465,4 +465,10 @@ public class StrUtilTest {
|
||||
Assert.assertTrue(StrUtil.startWith(a, b));
|
||||
Assert.assertFalse(StrUtil.startWithIgnoreEquals(a, b));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void indexedFormatTest() {
|
||||
final String ret = StrUtil.indexedFormat("this is {0} for {1}", "a", 1000);
|
||||
Assert.assertEquals("this is a for 1,000", ret);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user