Function replaceAll

  • Example

    import * as S from "flurp/string";

    const underscoreForE = S.replace("e", "_");
    const vowelToUpper = S.replace(/[aeiou]/, S.toUpperCase);
    underscoreForE("weasel"); // "w_as_l"
    vowelToUpper("weasel"); // "wEAsEl"

    Parameters

    • target: string | RegExp

      (if RegExp, must include the global flag)

    • replacement: string | ((s: string, ...args: unknown[]) => string)

    Returns ((s: string) => string)

      • (s: string): string
      • Parameters

        • s: string

        Returns string