• Returns the string that removed the leftmost given string

    Parameters

    • Optionaltext: null | string

      the text to inspect

    • Optionalremove: null | string

      the string to remove

    Returns string | undefined | null

    the string that removed the leftmost given string

    removeEnd('foobar', 'hello');    // 'foobar'
    removeEnd('foobar', 'bar'); // 'foo'