In ruby, The separation at the split is done at most limit-1 times, with max limit number of elements returned.
> "a-b-c-d-e-f".split("-",3) => ["a", "b", "c-d-e-f"]
Java has the same behavior
String parts = "a-b-c-d-e-f".split("-", 3); => ["a", "b", "c-d-e-f"]
Perl has that same behavior as well
split('-','a-b-c-d-e-f',3) => ["a", "b", "c-d-e-f"]
In python, the limit is the number of times the string is split on the separator, with the final element of the array being the rest of the string (split max limit times, max limit+1 elements returned). It’s not the same, but you’re still getting all the parts necessary to do what you need.
>>> "a-b-c-d-e-f".split('-',2) => ['a', 'b', 'c-d-e-f']
"a-b-c-d-e-f".split('-',2) => ["a", "b"]
What happens to the rest? Who knows! Who cares, right? That isn’t useful at all! Don’t even pay attention to the fact that the limit is completely irrelevant and can be easily (and more intuitively) attained by “a-b-c-d-e-f”.split(‘-‘).slice(0,2).
Everything else is mostly OK.