On Sep 24, 2007, at 3:30 PM, Phrogz wrote:

> I want to keep running gsub! on a string until it returns nil. How do
> you prefer to do this?
>
> true while str.gsub!( ... )
>
> while str.gsub!( ... ); end
>
> begin
>   done = !str.gsub!( ... )
> end until done
>
> begin
>   made_replacement = str.gsub!( ... )
> end while made_replacement
>
> ...some other way?

loop { break if str.gsub!(...).nil? }

because it clearly expresses the idea of "keep running gsub! on a  
string until it returns nil".

Regards, Morton