change to wrapAllWithPair

This commit is contained in:
Looly
2020-08-27 16:38:01 +08:00
parent ed4d819ed4
commit 50837bf2f9
3 changed files with 16 additions and 6 deletions

View File

@@ -458,4 +458,13 @@ public class StrUtilTest {
String cleanBlank = StrUtil.filter(" 你 好 ", c -> !CharUtil.isBlankChar(c));
Assert.assertEquals("你好", cleanBlank);
}
@Test
public void wrapAllTest(){
String[] strings = StrUtil.wrapAll("`", "`", StrUtil.splitToArray("1,2,3,4", ','));
Assert.assertEquals("[`1`, `2`, `3`, `4`]", StrUtil.utf8Str(strings));
strings = StrUtil.wrapAllWithPair("`", StrUtil.splitToArray("1,2,3,4", ','));
Assert.assertEquals("[`1`, `2`, `3`, `4`]", StrUtil.utf8Str(strings));
}
}