Phlip
4/10/2009 1:52:00 AM
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.