From: Patrick Gundlach Date: 2005-12-08T01:07:34+09:00 Subject: Re: increasing counter whithin loop? > Maybe I missed something. You missed to read my mind; my explanation was very unclear. I wanted to have something like "if two 'b' are consecutive, output 'double b' and continue with the element behind the second". 'a' 'b' 'b' 'c' 'b' 'd' -> 'a' 'double b' 'c' 'b' 'd' This is why I thought for i in sequence if sequence[i]=='b' and sequence[i+1]=='b' output 'double b' # increase i, so that the second 'b' won't be seen by the for-loop # but ruby won't let me!? # i += 1 does nothing else output sequence[i] end end would work, but I can't change the i in the for-loop. This is a pity! Patrick