Actions
Feature #3575
closedString#split is inconsistent with empty string and negative limit
Feature #3575:
String#split is inconsistent with empty string and negative limit
Description
Actions
Added by Conrad.Irwin (Conrad Irwin) almost 16 years ago. Updated about 6 years ago.
Description
I think Ruby thinks "" has no fields, not one field which have empty string.
So, "".split(",", -1) should return [].
Documentation issue, maybe.
I will add a note to the documentation to cover the behavior of empty strings.
This issue was solved with changeset r35275.
Conrad, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.