1.0.2 • Published 5 years ago
between-two-characters v1.0.2
between-two-characters
Extract the first or all the words that are between two pre-selected characters!
Install
npm install between-two-characters --save
Usage
const between = require('between-two-characters');
Functions()
cutOne(string, first_character, second_character)
Extract the first word between these two characters.
const text = "Hey there, my name is {name}, how you doing today?"
between.cutOne(text, "{", "}"); //returns "name"
cut(string, first_character, second_character)
Extract an array with all the words that are between these two characters.
const text = "Hey {there}, my name is {name}, {how} you {doing} today?"
between.cut(text, "{", "}");
//['there','name','how','doing']
LICENSE
MIT