From: "David A. Black" Date: 2007-09-26T18:18:41+09:00 Subject: Re: Favorite idiom for "keep doing this until it returns nil/false" Hi -- On Wed, 26 Sep 2007, William James wrote: > On Sep 24, 2:27 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!( ... ) > > Less prolix: > > 0 while str.gsub!( ... ) I wouldn't worry; the first version isn't exactly "War and Peace" :-) I dislike the throwaway nature of both of them anyway. David -- Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info!