Share your code. Components are building blocks, you are the architect.

utils/replace
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
1     DEPENDENCIES
Build: fail
BuildFail
Build Status: fail
Replace a substring or regex match in a string with a replacement.

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/replace in your project
npm i @bit/bit.ramda.utils.replace
Copied

replace (pattern:(RegExp | String), replacement:String, str:String) : String

Replace a substring or regex match in a string with a replacement.

Example

R.replace('foo', 'bar', 'foo foo foo'); //=> 'bar foo foo'
     R.replace(/foo/, 'bar', 'foo foo foo'); //=> 'bar foo foo'

     // Use the "g" (global) flag to replace all occurrences:
     R.replace(/foo/g, 'bar', 'foo foo foo'); //=> 'bar bar bar'

Arguments

pattern: (RegExp | String)

A regular expression or a substring to match.

replacement: String

The string to replace the matches with.

str: String

The String to do the search and replacement in.

Returns

String

The result.