npm.io
1.0.12 • Published 3 years ago

string-split-keep2

Licence
MIT
Version
1.0.12
Deps
0
Size
38 kB
Vulns
0
Weekly
0
Stars
26

string-split-keep

Split strings without applying separator after limit; Negative limit starts from the end. No regex separators.

	var ssplit = require("string-split-keep")  
	  
	ssplit("word1 word2 word3", " ", 2) //["word1", "word2 word3"]  
	ssplit("word1 word2 word3", " ", -2) //["word1 word2", "word3"]

Keywords