Issue #4335 has been updated by nahi.

Description updated
Status changed from Feedback to Rejected

It's intended feature, and -1 is prepared for your purpose as Nobu said. #3575
----------------------------------------
Feature #4335: String#split for empty string is always empty array
https://bugs.ruby-lang.org/issues/4335#change-24904

Author: phasis68
Status: Rejected
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0


=begin
 Here is ruby's behavior:
 
 C:\work>irb
 irb(main):001:0> ' '.split('/')
 => [" "]
 irb(main):002:0> ''.split('/')
 => []
 irb(main):003:0> '/'.split('/')
 => []
 
 Here is python's behavior:
 Python 2.4.3 (#1, Jun 11 2009, 14:09:37)
 [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> ' '.split('/')
 [' ']
 >>> ''.split('/')
 ['']
 >>> '/'.split('/')
 ['', '']
 
 Is there any chance of ''.split('/') returns [''] instead of []?
=end



-- 
http://bugs.ruby-lang.org/