From: Robert Klemme Date: 2011-07-18T20:31:55+09:00 Subject: Re: Array#each vs. Array#each_index iteration On Mon, Jul 18, 2011 at 1:19 PM, Markus Fischer wrote: > On 18.07.2011 13:05, Robert Klemme wrote: >> >> Have you been referred to #each_with_index already? > > Do you mean Array#each_index ? >> >> array.each{|entry, index| >>  p index if entry == "out" >> } > > Because in the example you still used "each" :) My bad. No, I meant #each_with_index. array.each_with_index do |entry, index| p index if entry == "out" end Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/