@nevware21/ts-utils
    Preparing search index...

    Function strReplace

    • The strReplace() method returns a new string with one, some, or all matches of a pattern replaced by a replacement.

      Parameters

      • value: string

        The string value to search and replace within.

      • searchValue: string | RegExp

        The value to search for. Can be a string or regular expression.

      • replaceValue: string | ((substring: string, ...args: any[]) => string)

        The replacement string or replacer function.

      Returns string

      A new string with one, some, or all matches replaced.

      0.14.0

      strReplace("a-b-a", "a", "x");         // "x-b-a"
      strReplace("a1b2", /\d/g, "#"); // "a#b#"
      strReplace("hello", /[aeiou]/, "*"); // "h*llo"