Options
All
  • Public
  • Public/Protected
  • All
Menu

Module replace

Index

Functions String

String Functions

  • replace(...args: any[]): string
  • Replaces matches for pattern in string with replacement.

    Note: This method is based on String#replace.

    since

    5.8.0

    see

    truncate, trim

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

    Parameters

    • Rest ...args: any[]

    Returns string

    Returns the modified string.