Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > Text > replaceAll

Text.replaceAll() method

Returns the same thing as targetString.replace(searchValue, replaceValue), except that all matches are replaced, rather than just the first match.

Signature:

static replaceAll(input: string, searchValue: string, replaceValue: string): string;

Parameters

ParameterTypeDescription
inputstringThe string to be modified
searchValuestringThe value to search for
replaceValuestringThe replacement text

Returns:

string