Skip to content

StringUtils.isWhitespace

Signature: StringUtils.isWhitespace(inputString)

Returns: Boolean result - true if the inputString contains only whitespace or is empty

Checks if the inputString contains only whitespace. null will return false. An empty ("") string will return true.

Parameters

Type Name Description Default
String inputString the String to check, may be null

Example

StringUtils.isWhitespace(' ');        // true
StringUtils.isWhitespace('\t\t\t\t'); // true
StringUtils.isWhitespace('\r\n');     // true