From: Leslie Viljoen Date: 2006-08-12T17:02:18+09:00 Subject: Re: Dire need for inject_with_index On 8/12/06, James Edward Gray II wrote: > Hope this helps: > > >> require "enumerator" > => true > >> module Enumerable > >> def inject_with_index(*args, &block) > >> enum_for(:each_with_index).inject(*args, &block) > >> end > >> end > => nil > >> ("A".."D").inject_with_index("") do |str, (let, i)| > ?> i % 2 == 0 ? str += let : str > >> end > => "AC" That most certainly does! Les