Skip to content

StringUtils.isNotBlank

Signature: StringUtils.isNotBlank(inputString)

Returns: Boolean isNotBlank - true if the inputString is not null and not empty and not whitespace and not exactly "undefined"

Checks if the inputString is not null, not empty (""), not whitespace only, and not exactly the string "undefined".

Note

A JavaScript value that is undefined (an undeclared variable, a missing object property, or an argument that was not passed) reaches this function as the literal string "undefined", so this function returns false. The comparison ignores case, and the value must be exactly "undefined" with no surrounding whitespace.

Parameters

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

Example

StringUtils.isNotBlank("      ");           // false
StringUtils.isNotBlank("");                 // false
StringUtils.isNotBlank("undefined");        // false
StringUtils.isNotBlank("    pomme       "); // true