Hi,
Try this..

var1 = 'ghi'
new_string = "abcdef#{var1}jklmnop"

I think you forgot to put the # before the braces and also double quoted string is must for this kind of substitution.

Regards,
Angrez

On Wed, 27 Jul 2005 Torres,Ben(HQP) wrote :
>Right now, I am doing this:
>
>var1 = 'ghi'
>new_string = 'abcdef' + var1 + 'jklmnop'
>
>Is there any way I can insert the variable name within the string?  I
>tried doing this, but it didn't work:
>
>New_string = 'abcdef{var1}jklmnop'
>
>
>_______________________________________________
>Wtr-general mailing list
>Wtr-general@rubyforge.org
>http://rubyforge.org/mailman/listinfo/wtr-general



_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to