isNotBlank
Checks if a string is not blank — non-empty and contains at least one
non-whitespace character.
null and undefined are considered blank and return false.
Uses String.prototype.trim() internally. See isBlank for the full list
of characters considered whitespace (includes non-breaking space, en/em space,
ideographic space, etc.).
Available since v2.0.3
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | null | undefined | The string to check |
Returns
Section titled “Returns”boolean — true if the string has at least one non-whitespace character; false for blank, null, or undefined
Examples
Section titled “Examples”Check that a string has real content
Section titled “Check that a string has real content”Returns true only when the string contains at least one non-whitespace character.
Filter out blank strings from an array
Section titled “Filter out blank strings from an array”Use as a predicate in .filter() to keep only strings with real content.
