Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/main/java/org/apache/commons/lang3/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public static String abbreviate(final String str, final String abbrevMarker, fin
* StringUtils.abbreviate("abcdefghijklmno", ",", 2, 10) = "abcdefghi,"
* StringUtils.abbreviate("abcdefghijklmno", "::", 4, 10) = "::efghij::"
* StringUtils.abbreviate("abcdefghijklmno", "...", 6, 10) = "...ghij..."
* StringUtils.abbreviate("abcdefghijklmno", "…", 6, 10) = "…ghij…"
* StringUtils.abbreviate("abcdefghijklmno", "…", 6, 10) = "…ghijklmno"
* StringUtils.abbreviate("abcdefghijklmno", "*", 9, 10) = "*ghijklmno"
* StringUtils.abbreviate("abcdefghijklmno", "'", 10, 10) = "'ghijklmno"
* StringUtils.abbreviate("abcdefghijklmno", "!", 12, 10) = "!ghijklmno"
Expand Down Expand Up @@ -8845,18 +8845,19 @@ public static String trim(final String str) {
}

/**
* Removes control characters (char <= 31) from both ends of this String, handling {@code null} by returning {@code null}.
* Removes {@link CharUtils#isAsciiControl(char) ASCII control characters} (char <= 31 or char == 127) from both ends of this String, handling
* {@code null} by returning {@code null}.
*
* <p>
* To trim your choice of characters, use the {@link #strip(String, String)} methods.
* </p>
*
* <pre>{@code
* StringUtils.trim(null) = null
* StringUtils.trim("") = ""
* StringUtils.trim("abc\u0000") = "abc"
* StringUtils.trim("abc") = "abc"
* StringUtils.trim(" abc ") = " abc "
* StringUtils.trimAsciiControl(null) = null
* StringUtils.trimAsciiControl("") = ""
* StringUtils.trimAsciiControl("abc\u0000") = "abc"
* StringUtils.trimAsciiControl("abc") = "abc"
* StringUtils.trimAsciiControl(" abc ") = " abc "
* }</pre>
*
* @param str The String to be trimmed, may be null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ void testAbbreviate_StringStringIntInt() {
assertAbbreviateWithAbbrevMarkerAndOffset("abcdef____", "____", 5, 10);
assertAbbreviateWithAbbrevMarkerAndOffset("==fghijk==", "==", 5, 10);
assertAbbreviateWithAbbrevMarkerAndOffset("___ghij___", "___", 6, 10);
assertAbbreviateWithAbbrevMarkerAndOffset("…ghijklmno", "…", 6, 10);
assertAbbreviateWithAbbrevMarkerAndOffset("/ghijklmno", "/", 7, 10);
assertAbbreviateWithAbbrevMarkerAndOffset("/ghijklmno", "/", 8, 10);
assertAbbreviateWithAbbrevMarkerAndOffset("/ghijklmno", "/", 9, 10);
Expand Down
Loading