Function removeFirstIgnoreCase

  • Returns the string that removed the first occurrence in the given text, case-insensitive

    Parameters

    • Optionaltext: null | string

      the text to inspect

    • Optionalsearch: null | string | RegExp

      the string or regex to match

    Returns string | undefined | null

    the string that removed the first occurrence in the given text, case-insensitive

    removeFirstIgnoreCase(undefined, undefined);    // undefined
    removeFirstIgnoreCase('foobar-foobar', undefined); // 'foobar-foobar'
    removeFirstIgnoreCase('foobar-foobar', 'BAR'); // 'foo-foobar'