Replace all ocurrences of 'search' value to 'newvalue'.
Install
Install all functions of strman
yarn add strman
or just the replace function
yarn add strman.replace
Usage
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'