0.1.4 • Published 7 years ago

add-remove-replace v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

add-remove-replace

Build Status

Simple library to add, remove or replace content inside strings.

Usage

Install it with npm install add-remove-replace.

Import it with

import addRemoveReplace from 'add-remove-replace';

addRemoveReplace.add('123', 'String'); // 123String

Or import directly add, remove or replace:

import { add, remove, replace } from 'add-remove-replace';

add('123', 'String'); // 123String

Functions

add

add(content: string, target: ?string, atBeginning: boolean = true)
// add 123 at the beginning
add('123', 'String'); // '123String'

// add 123 to the end
add('123', 'String', false); // 'String123'

remove

remove(content: string, target: ?string)
// remove all 123
remove('123', '123String'); // 'String'

replace

replace(content: string, newContent: string, target: ?string)
// replace all 123
replace('123', '_', '123String'); // '_String'
0.1.4

7 years ago

0.1.3

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago