tc39 / proposal-reversible-string-split

String.prototype.splitn for ECMAScript
MIT License
82 stars 4 forks source link

Also add splitOnce ? #14

Open hax opened 2 years ago

hax commented 2 years ago

As many comments, it's clear that a very common use case is splitting the string into two parts, so maybe we could also add splitOnce(sep) (shorthand for splitN(2, sep)).

Prior arts:

ljharb commented 2 years ago

That seems like a high cost to avoid 2,.