[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

replacing spaces

Vapor ..

11/19/2007 1:14:00 PM

I have a long string "that looks like this". I want to replace all
spaces in the string with " and ".
--
Posted via http://www.ruby-....

2 Answers

Stefano Crocco

11/19/2007 1:16:00 PM

0

Alle luned=C3=AC 19 novembre 2007, Vapor .. ha scritto:
> I have a long string "that looks like this". I want to replace all
> spaces in the string with " and ".

"that looks like this".gsub(" ", " and ")
=3D> that and looks and like and this

Stefano

Vapor ..

11/19/2007 1:22:00 PM

0

Stefano Crocco wrote:
> Alle lunedì 19 novembre 2007, Vapor .. ha scritto:
>> I have a long string "that looks like this". I want to replace all
>> spaces in the string with " and ".
>
> "that looks like this".gsub(" ", " and ")
> => that and looks and like and this
>
> Stefano

thanks :)
--
Posted via http://www.ruby-....