Function replace

  • Replace first match of given pattern by replacement.

    Parameters

    • x: string

      a string

    • pattern: string

      substring to match

    • replacement: string

      replacement substring

    Returns string

    replaced string

  • Replace first or all matches of given pattern by replacement.

    Parameters

    • x: string

      a string

    • pattern: string | RegExp

      pattern to match

    • replacement: string | ReplaceFunction

      replacement substring or replacer

    Returns string

    replaced string

Generated using TypeDoc