• Determines whether a string contains one or more white space characters and no other characters.

    This implementation uses dotnet's Char.IsWhiteSpace definition of white space:

    /^[\u000C\u000A\u000D\u0009\u000B\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\u0085]+$/.test(
    ch,
    );

    Note: This differs from /\s/.test(ch) (usually considered the determiner of what is white space in JavaScript) in that it does not include ZWNBSP (U+FEFF) but rather includes NEXT LINE (U+0085)

    Parameters

    • ch: string

      Single character or a string of characters

    Returns boolean

    true if the string consists of one or more white space characters and no other characters, false otherwise