(require("@nginstack/engine/lib/string/replaceAll"))(str, searchValue, replaceValue)
Retorna uma nova string com todas as ocorrências de searchValue em str substituídas por
replaceValue.
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string | A string que terá as ocorrências |
searchValue |
string | Valor a ser substituído. |
replaceValue |
string | Valor que substituíra |
Returns:
Uma nova string com as ocorrências de searchValue substituídas.
- Type
- string
Example
const replaceAll = require('@nginstack/engine/lib/string/replaceAll');
replaceAll('test abc test abc', 'abc', 'ok'); // => 'test ok test ok'