From: Malte Milatz Date: 2005-12-05T23:37:33+09:00 Subject: Re: increasing counter whithin loop? Patrick Gundlach: > I'd like to output the sequence "a b d e", by testing if the current > element is == "b" then skip the next element and continue the loop. I do not know whether I understood correctly what you want, but you could try this: array = [ :a, :b, :c, :d, :e ] array.each_with_index do |x, i| next if array[i-1] == :b print x, ' ' end Malte