Split a string only once
- Node.js ≥ 8.9.0
const splitOnce = require('split-string-once')
const a = splitOnce('abc,def,ghi', ',') // ['abc', 'def,ghi']
const b = splitOnce('abcdefghi', ',') // ['abc,def,ghi']
console.log({a, b})
Split a string only once
const splitOnce = require('split-string-once')
const a = splitOnce('abc,def,ghi', ',') // ['abc', 'def,ghi']
const b = splitOnce('abcdefghi', ',') // ['abc,def,ghi']
console.log({a, b})
npm i split-string-once
1
0.0.2
MIT
1.25 kB
4