Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > replacing spaces

Reply
Thread Tools

replacing spaces

 
 
Vapor ..
Guest
Posts: n/a
 
      11-19-2007
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-forum.com/.

 
Reply With Quote
 
 
 
 
Stefano Crocco
Guest
Posts: n/a
 
      11-19-2007
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

 
Reply With Quote
 
 
 
 
Vapor ..
Guest
Posts: n/a
 
      11-19-2007
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-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSD to allow A-Z 0-9 and spaces, but not leading/trailing spaces johkar XML 2 12-10-2009 09:24 AM
[CSS] how can I show spaces as spaces? Tomasz Chmielewski HTML 21 09-10-2009 06:43 PM
how can I show spaces as spaces, part 2 Tomasz Chmielewski HTML 14 09-10-2009 03:54 PM
Re: How to trim a String trailing spaces, but not leading spaces? Roedy Green Java 3 09-14-2008 02:10 AM
Re: How to trim a String trailing spaces, but not leading spaces? John B. Matthews Java 4 09-12-2008 05:28 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57