JS Utils Kit
    Preparing search index...

    Variable trimConst

    trim: Trim = ...

    Trims whitespace from a string with methods for leading and trailing and normalizing whitespace.

    The string to trim.

    The string with leading and trailing whitespace removed.

    'trims both sides'
    
    // Trim both sides
    console.log(trim(" hello ")); // "hello"
    console.log(trim("")); // ""
    console.log(trim("hello")); // "hello"

    // Trim leading whitespace
    console.log(trim.start(" hello ")); // "hello "
    console.log(trim.start("")); // ""
    console.log(trim.start("hello")); // "hello"

    // Trim trailing whitespace
    console.log(trim.end(" hello ")); // " hello"
    console.log(trim.end("")); // ""
    console.log(trim.end("hello")); // "hello"

    // Normalize whitespace
    console.log(trim.normalizeWhitespace(" hello world ")); // "hello world"
    console.log(trim.normalizeWhitespace("hello\t world")); // "hello world"
    console.log(trim.normalizeWhitespace("")); // ""