Project

General

Profile

Bug #12108

Splitting an empty string returns an empty array

Added by sawa (Tsuyoshi Sawada) almost 4 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:73962]

Description

Splitting an empty string returns an empty array.

"".split("") # => []
"".split("a") # => []
"".split(//) # => []
"".split(/a/) # => []

History

Updated by sawa (Tsuyoshi Sawada) almost 4 years ago

Sorry, it turns out that this was a feature (http://ruby-doc.org/core-2.3.0/String.html#method-i-split). I didn't know. I would like to retract this bug report.

Updated by Eregon (Benoit Daloze) almost 4 years ago

  • Status changed from Open to Rejected

Also available in: Atom PDF