Project

General

Profile

Feature #4335

Updated by nahi (Hiroshi Nakamura) over 12 years ago

=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 
 

Back