• Checks if a String contains only whitespace characters

    Example

    Returns true if the String is empty

    const result = isBlank("");
    console.log(result); // true

    Example

    Returns true if the String contains only whitespace characters

    const result = isBlank(" ");
    console.log(result); // true

    Example

    Returns false if the String contains any non-whitespace character

    const result = isBlank(" a ");
    console.log(result); // false

    Returns

    true if the String is empty or all characters are whitespace, otherwise false

    Parameters

    • str: string

      the String to check

    Returns boolean

Generated using TypeDoc