Project

General

Profile

Feature #4780

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

Mentioned before, in another (rejected) issue thread: http://redmine.ruby-lang.org/issues/4615 

 There are a few methods, which return an array without a trailing block, or also can be iterated with a block. 

 Such as `String#scan`. String#scan. 

 `String#split` String#split has only one form: 

 ```ruby 
 str.split(pattern=$;, limit=0) -> array 
 ``` 

 Maybe add a iterative form, when with a block: 

 ```ruby 
 str.split(pattern=$;, limit=0) {|field| ... } -> str 
 ``` 

 If the string is very long, and I only need to play with the splitted string one by one, this will not create a useless expensive array. 

 Joey

Back