@jswork/next-slice2str
v1.0.7
Published
Slice string to two part.
Readme
next-slice2str
Slice string to two part.
installation
npm install -S @jswork/next-slice2strapis
| argument | type | default | |----------|--------|---------| | str | String | - | | index | Number | - | | step | Number | 0 |
usage
import '@jswork/next-slice2str';
const str = '[email protected]';
const idx = str.indexOf('@');
const arr1 = nx.slice2str(str, idx);
const arr2 = nx.slice2str(str, idx, 1);
// [ 'test', '123.com' ]
// [ 'test', '123.com' ]license
Code released under the MIT license.
