J
John Carter
Ok, I'm being stupid probably...
But I can't spot a method to do string interpolation.
I have a string...
a = 'bra#{c}ket'
The variable c isn't available at the stage of setting that up. Hence
the use of '' instead of "".
The variable will be available later....
At that stage I want to do something like...
c=' see '
a.interpolate
The closest I can get is a bit fugly...
eval "\"#{a}\""
=> "bra see ket"
Any better way?
Thanks,
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : (e-mail address removed)
New Zealand
But I can't spot a method to do string interpolation.
I have a string...
a = 'bra#{c}ket'
The variable c isn't available at the stage of setting that up. Hence
the use of '' instead of "".
The variable will be available later....
At that stage I want to do something like...
c=' see '
a.interpolate
The closest I can get is a bit fugly...
eval "\"#{a}\""
=> "bra see ket"
Any better way?
Thanks,
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : (e-mail address removed)
New Zealand