From: Robert Klemme Date: 2009-05-06T20:01:54+09:00 Subject: Re: removing Whitespace using regexp 2009/5/6 Sriram Varahan : > How about doing a gsub on the output to remove white spaces. > > For example: > > "Example Web Page".gsub(" ","") > > This would remove the white spaces. I would rather do s.gsub /\s+/, ' ' Because your statement removes *all* whitespace: irb(main):002:0> "Example Web Page".gsub(" ","") => "ExampleWebPage" This is usually not what you want. > Hope this helps. Dito. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/