sp core library.text_2.replaceall - microsoft/Viva-Connections-Extensibility-Beta GitHub Wiki

Home > @microsoft/sp-core-library > Text_2 > replaceAll

Text_2.replaceAll() method

Returns the input string, with all instances of searchValue replaced by replaceValue.

Signature:

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

Parameters

Parameter Type Description
input string The string to be modified
searchValue string The value to search for
replaceValue string The replacement text

Returns:

string

Remarks

Note that JavaScript's string.replace() only replaces the first match, unless a global RegExp is provided.

⚠️ **GitHub.com Fallback** ⚠️