From: Phlip Date: 2009-04-10T10:55:20+09:00 Subject: Re: DRY up consecutive gsub's - How to RichardOnRails wrote: > Each of the following one-liners failed: > col_name.gsub!(/[\s]/, ""). gsub!(/[&]/, "And").gsub!(/[#]/, > "Number") if col_name col_name = col_name.to_s.gsub(/[\s]/, ""). gsub(/[&]/, "And").gsub(/[#]/, "Number") If you don't mind col_name shifting from a nil to a blank. Also, the [] brackets add no value - both [\s] and \s are a one-width match.