• Removes all whitespace characters (spaces, tabs, newlines) from a given string.

    Parameters

    • s: string

      The input string from which to remove whitespace.

    Returns string

    A new string with all whitespace characters removed.

    Example

    stripWhitespace("  Hello   World  "); // "HelloWorld"
    stripWhitespace("\tExample\nString "); // "ExampleString"
    stripWhitespace(""); // ""