Strings.isWhitespace()
Syntax
function isWhitespace(string: string): boolean
Checks if a string is empty or contains only whitespace.
Parameters | |
string
|
The string to check. |
Example
import { Strings } from 'potence';
Strings.isWhitespace(''); // -> true
Strings.isWhitespace(' '); // -> true
Strings.isWhitespace('banana bread'); // -> false
Remarks
Here whitespace refers to: all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.).
Compare Strings.isEmpty()
.