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:
split-on-first npm package by @sindresorhus , 5000k+ weekly downloads
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 forsplitN(2, sep)
).Prior arts:
split_once
https://doc.rust-lang.org/std/string/struct.String.html#method.split_once