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 ltrim = org.apache.commons.lang3.StringUtils.stripStart(src, " ");
|
||||||
String rtrim = org.apache.commons.lang3.StringUtils.stripEnd(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);
|
return checkStrings(ltrim, rtrim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,13 @@ public class LTrimRTrimUnitTest {
|
|||||||
|
|
||||||
// Compare the Strings obtained and the expected
|
// Compare the Strings obtained and the expected
|
||||||
Assert.assertTrue(ltrimResult.equalsIgnoreCase(ltrim));
|
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));
|
Assert.assertTrue(rtrimResult.equalsIgnoreCase(rtrim));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user