Issue #6445 has been updated by knu (Akinori MUSHA).


It would look nice and work fine with indexing strings and arrays, but if it were put in you would've come to want (1..).each {|i| .. } to work as well.

It might be better to default the omitted end to +Infinity and then make {Array,String,..}#[] understand +Infinity as an index, I guess?

----------------------------------------
Feature #6445: request for default length/position on string index
https://bugs.ruby-lang.org/issues/6445#change-26946

Author: botp (bot pena)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: 
Target version: 2.0.0


would be nice if ruby has default for "rest or up to end of string"

eg

"hello"[2,] =>	should default to "hello"[2..-1]
or 
"hello"[2..] => should default to "hello"[2..-1]



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