From: Michael Fellinger Date: 2008-03-05T21:08:45+09:00 Subject: Re: collect with index? On Wed, Mar 5, 2008 at 9:00 PM, Sebastian Hungerecker wrote: > Tim Conner wrote: > > simple question: how can I do a collect with index? > > In 1.8: require 'enumerator'; foo.to_enum(:each_with_index).collect {|x,i| } require 'enumerator' [:a, :b, :c].enum_with_index.map{|x, i| } > In 1.9: foo.collect.with_index {|x,i| } > > HTH, > Sebastian > -- > Jabber: sepp2k@jabber.org > ICQ: 205544826 > >