weak-split
v1.0.1
Published
Split a string, discarding empty leading and trailing elements in the output
Downloads
3
Readme
Weak Split
Split a string, discarding empty leading and trailing elements in the output.
Example
const string = 'Banana, Orange, Apple,';
string.split(/,\s?/); // ['Banana', 'Orange', 'Apple', '']
const weakSplit = require('weak-split');
weakSplit(string, /,\s?/); // ['Banana', 'Orange', 'Apple']
Install
npm install weak-split --save