add-remove-replace
Simple library to add, remove or replace content inside strings.
Usage
Install it with npm install add-remove-replace
.
Import it with
; addRemoveReplace; // 123String
Or import directly add
, remove
or replace
:
; ; // 123String
Functions
add
add(content: string, target: ?string, atBeginning: boolean = true)
// add 123 at the beginning; // '123String' // add 123 to the end; // 'String123'
remove
remove(content: string, target: ?string)
// remove all 123; // 'String'
replace
replace(content: string, newContent: string, target: ?string)
// replace all 123; // '_String'