JS Utils Kit - v0.5.1
    Preparing search index...

    Interface Trim

    String trimming utilities. Trims whitespace from a string (both sides by default) with methods for leading and trailing and normalizing whitespace.

    interface Trim {
        function(str: string): string;
        start(str: string): string;
        end(str: string): string;
        normalizeWhitespace(str: string): string;
    }
    Index

    Methods

    • Removes whitespace from both ends of a string.

      Parameters

      • str: string

        The string to trim.

      Returns string

      The trimmed string.

    • Removes leading whitespace from a string.

      Parameters

      • str: string

        The string to trim.

      Returns string

      The string with leading whitespace removed.

    • Removes trailing whitespace from a string.

      Parameters

      • str: string

        The string to trim.

      Returns string

      The string with trailing whitespace removed.

    • Trims the string and replaces sequences of whitespace with a single space.

      Parameters

      • str: string

        The string to normalize.

      Returns string

      The string with normalized whitespace.