1.0.6 • Published 2 years ago

@jswork/next-slice2str v1.0.6

Weekly downloads
4
License
MIT
Repository
-
Last release
2 years ago

next-slice2str

Slice string to two part.

version license size download

installation

npm install -S @jswork/next-slice2str

apis

argumenttypedefault
strString-
indexNumber-
stepNumber0

usage

import '@jswork/next-slice2str';

const str = 'test@123.com';
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.