• Replaces matches for pattern in string with replacement.

    Note: This method is based on String#replace.

    Parameters

    • string: string
    • pattern: string | RegExp
    • replacement: string | ReplaceFunction

    Returns string

    Returns the modified string.

  • Parameters

    • pattern: string | RegExp
    • replacement: string | ReplaceFunction

    Returns string

    _.replace