Function replaceAllIgnoreCase

  • Returns the string that replaced all occurrences in the given text, case-insensitive

    Parameters

    • Optionaltext: null | string

      the text to inspect

    • Optionalsearch: null | string | RegExp

      the string or regex to match

    • Optionalreplace: null | string

      the expected replacement string

    Returns string | undefined | null

    the string that replaced all occurrences in the given text, case-insensitive

    replaceAllIgnoreCase(undefined, undefined, undefined);    // undefined
    replaceAllIgnoreCase('foobar-foobar', undefined, 'hello'); // 'foobar-foobar'
    replaceAllIgnoreCase('foobar-foobar', 'FOOBAR', 'hello'); // 'hello-hello'