[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Substituting variables in a method

seebs

5/23/2007 4:39:00 AM

In message <pYM4i.345947$g24.243267@newsfe12.phx>, "Michael W. Ryder" writes:
>How does one know when to use string interpolation and when it isn't
>needed? I know that if I want to put a variable in the middle of a
>string I have to use interpolation so I thought I also needed something
>like that in this case as I didn't want to convert c's to d's.

It's simple. If you are trying to embed a variable in a literal string, you
need string interpolation. That's it. That's the only time you need it.

-s