Function replace

  • Replaces matches for pattern in string with replacement.

    Note: This method is based on String#replace.

    Parameters

    • Rest...args: any[]

    Returns string

    Returns the modified string.

    5.8.0

    [[truncate]], [[trim]]

    replace('Hi Fred', 'Fred', 'Barney')
    // => 'Hi Barney'