Re: increasing counter whithin loop?

perhaps:

a.inject(false) do |skip, elt|
puts elt if !skip
elt==“b”
end

(no, I don’t think this is realy nice)

cheers

Simon

On Mon, 05 Dec 2005 15:13:46 +0100, Kroeger, Simon (ext)
[email protected] wrote:

(no, I don’t think this is realy nice)

Here is another (not really nice) way to do it, using the flip-flop
operator:

%w( a b c d b e ).each { |el| nil if (puts(el) || el == “b”)…true }
a
b
d
b

Dominik