Function containsWhitespace

  • Namespace

    StringUtils

    Check if a string contains whitespace.

    Parameters

    • str: string

      The input string to check.

    Returns boolean

    True if the string contains whitespace, false otherwise.

    Example

    const inputString1 = "Hello, world!"; // No whitespace
    const inputString2 = "Hello, world! "; // Contains whitespace

    console.log(containsWhitespace(inputString1)); // Output: false
    console.log(containsWhitespace(inputString2)); // Output: true

Generated using TypeDoc