separator-escape

split a string by a separator, with an escape.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
separator-escape
700.0.16 years ago8 years agoMinified + gzip package size for separator-escape in KB

Readme

separator-escape
split a string by a separator, with an escape.
you can choose both the separate and escape.

example

//separate by , and escape by !
var sep = require('separator-escape')(',','!')
sep.stringify(['a','b','c'])
// => "a,b,c"
// escape separator
sep.stringify(['a','x,y','c'])
// => a,x!,y,b

//escape escape
sep.stringify(['a','x!y','c'])
// => a,x!!y,b

//escape escape escape separator
sep.stringify(['a','x!,y','c'])
// => a,x!!!,y,b

License

MIT