Skip to content
Closed
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
21 changes: 7 additions & 14 deletions src/main/java/org/apache/commons/lang3/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3497,20 +3497,13 @@ public static boolean isAsciiPrintable(final CharSequence cs) {
}

/**
* Tests if a CharSequence is empty ({@code "")}, null, or contains only whitespace as defined by {@link Character#isWhitespace(char)}.
*
* <pre>
* StringUtils.isBlank(null) = true
* StringUtils.isBlank("") = true
* StringUtils.isBlank(" ") = true
* StringUtils.isBlank("bob") = false
* StringUtils.isBlank(" bob ") = false
* </pre>
*
* @param cs the CharSequence to check, may be null.
* @return {@code true} if the CharSequence is null, empty or whitespace only.
* @since 2.0
* @since 3.0 Changed signature from isBlank(String) to isBlank(CharSequence)
* Checks if a CharSequence is empty(""), null or whitespace only.
* <p>
* Whitespace is determined by {@link Charachter#isWhiteSpace(char)}
* </p>
*
* @param cs the CharSequence to check, may be null
* @return {@code true} if the CharSequence is empty, null or whitespace only
*/
public static boolean isBlank(final CharSequence cs) {
final int strLen = length(cs);
Expand Down