Replace all ocurrences of 'search' value to 'newvalue'.
Install
Install all functions of strman
yarn add strmanor just the replace function
yarn add strman.replaceUsage
import { replace } from 'strman'
// OR
import replace from 'strman.replace'Parameters:
| Name | Type | Description |
|---|---|---|
value |
String | The String! |
search |
String | String to search. |
newvalue |
String | String to replace. |
caseSensitive |
Boolean | if you use caseSensitive replace. |
multiline |
Boolean | if you use multiline replace. |
- Source:
Returns:
String replaced with 'newvalue'.
- Type
- String
Example
const title = 'superman'
replace(title, 'upe', 't')
// => 'strman'