@yookue/ts-lang-utils
    Preparing search index...

    Function replaceAll

    • Returns the string that replaced all occurrences in the given text

      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 undefined | null | string

      the string that replaced all occurrences in the given text

      David Hsing

      replaceAll(undefined, undefined, undefined);    // undefined
      replaceAll('foobar-foobar', undefined, 'hello'); // 'foobar-foobar'
      replaceAll('foobar-foobar', 'foobar', 'hello'); // 'hello-hello'