Actions
Bug #13925
closedstring.split(pattern, 1) should return [self.dup], but it returns [self]
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
Backport:
Description
msg = 'abababababa'
msg.split('b', 4).map(&:upcase!) # won't overwrite msg
puts msg # abababababa (expected)
msg.split('b', 1).map(&:upcase!) # this overwrites msg
puts msg # ABABABABABA (abababababa is expected)
I wrote a patch for this.
Files
Actions
Like0
Like0Like0Like0Like0Like0