Add null as stripChar for Apache Commons StringUtils example
This commit is contained in:
parent
020c3bd8c9
commit
aaabfa4ab2
@ -117,6 +117,9 @@ public class LTrimRTrim {
|
||||
String ltrim = org.apache.commons.lang3.StringUtils.stripStart(src, " ");
|
||||
String rtrim = org.apache.commons.lang3.StringUtils.stripEnd(src, " ");
|
||||
|
||||
ltrim = org.apache.commons.lang3.StringUtils.stripStart(src, null);
|
||||
rtrim = org.apache.commons.lang3.StringUtils.stripEnd(src, null);
|
||||
|
||||
return checkStrings(ltrim, rtrim);
|
||||
}
|
||||
|
||||
|
@ -69,10 +69,16 @@ public class LTrimRTrimUnitTest {
|
||||
// Use StringUtils containsIgnoreCase to avoid case insensitive issues
|
||||
String ltrim = org.apache.commons.lang3.StringUtils.stripStart(src, " ");
|
||||
String rtrim = org.apache.commons.lang3.StringUtils.stripEnd(src, " ");
|
||||
|
||||
// Compare the Strings obtained and the expected
|
||||
Assert.assertTrue(ltrimResult.equalsIgnoreCase(ltrim));
|
||||
Assert.assertTrue(rtrimResult.equalsIgnoreCase(rtrim));
|
||||
|
||||
ltrim = org.apache.commons.lang3.StringUtils.stripStart(src, null);
|
||||
rtrim = org.apache.commons.lang3.StringUtils.stripEnd(src, null);
|
||||
|
||||
// Compare the Strings obtained and the expected
|
||||
Assert.assertTrue(ltrimResult.equalsIgnoreCase(ltrim));
|
||||
|
||||
Assert.assertTrue(rtrimResult.equalsIgnoreCase(rtrim));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user