On 5/28/07, jochen kaechelin <gissmoh / figgfrosch.de> wrote:
> I want to remove all whitespaces in a string.
> I know strip to remove whitespaces at the beginning and the end
> of the string.
>
> example:
> "  bla   @   bla. de      "
>
> should become
> "bla / bla.de"
>
> How can I achieve this?

  You can use String.gsub [1]

irb(main):003:0> "  bla   @   bla. de      ".gsub(/\s+/, '')
=> "bla / bla.de"


[1] http://dev.rubycentral.com/ref/ref_c_string.html#gsub

-- 
Luis Parravicini
http://ktulu.com.ar/blog/