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?
>
> Thanx
>
>

This is probably slower, but here is another way you can try.

p "  bla   @   bla. de      ".split(/\s+/).join

Harry

-- 

A Look into Japanese Ruby List in English
http://www.kakueki.com/