1.1.2 • Published 2 years ago
jsmp-infra-iryna_omelchenko-remove-word-from-string v1.1.2
remove-word-from-string
This package was created for educational purposes. It removes a word from a string.
Prerequisites
This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
6.4.1
v8.16.0
Installation
BEFORE YOU INSTALL: please read the prerequisites
To install the package, run:
$ npm install remove-word-from-string
API
removeOne
removeOne(string: string = '', word: string = '')
Example:
const result = removeOne('Hello world!', 'world') // 'Hello !'
removeAll
removeAll(string: string = '', word: string = '')
Example:
const result = removeAll('Hello world, world, world!', 'world') // 'Hello , , !'
License
ISC