Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String.prototype.splitl = function(delim, limit) { // Split a string by delim into limit parts + remainder
- let parts = this.split(delim)
- let splits = parts.slice(0, limit)
- let remainder = parts.slice(limit).join(delim)
- splits.push(remainder)
- return splits
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement