Both implement an Iterator over slices of a string that is being split at a pattern, but
std::str::CharSplitsN splits at most N times, yielding N + 1 strings; while regex::RegexSplitsN splits at most N - 1 times, yielding N strings.
This is inconsistent and confusing, and one of them should be changed to have the semantic of the other, however it is unclear which is the better one.
Both implement an
Iteratorover slices of a string that is being split at a pattern, butstd::str::CharSplitsNsplits at mostNtimes, yieldingN + 1strings; whileregex::RegexSplitsNsplits at mostN - 1times, yieldingNstrings.This is inconsistent and confusing, and one of them should be changed to have the semantic of the other, however it is unclear which is the better one.