You're close!
New_string = 'abcdef#{var1}jklmnop'
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Torres, Ben
(HQP)
Sent: 27 July 2005 11:36
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Inserting variable name in string
Right now, I am doing
, 2005 7:43 PM
To: wtr-general@rubyforge.org
Subject: RE: [Wtr-general] Inserting variable name in string
You're close!
New_string = 'abcdef#{var1}jklmnop'
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Torres, Ben
(HQP)
Sent: 27 July 2005 11:36
To: wtr
Hi,
Try this..
var1 = 'ghi'
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 =
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'