From: lasitha Date: 2009-02-20T00:17:10+09:00 Subject: Re: Replacing values On Thu, Feb 19, 2009 at 7:39 PM, Andrew Timberlake wrote: > On Thu, Feb 19, 2009 at 3:41 PM, Ashikali Ashikali wrote: > >> Analyse this code >> >> a = 10 >> b = "This is #{a}" # prints "This is 10" >> b = 'This is #{c}' # prints "This is \#{c}" >> c = 18 >> >> b # "This is \#{c}" >> >> Here I want , >> "This is 18" >> >> Question , >> How can I convert '' value to "" value . >> -- >> > > Your question is not clear If i might venture a guess, i think Ashikali wants the interpolation to occur lazily. I don't know a way to construct a string that defers interpolation (though i suspect there must be one). If not, you could use 'eval' or perhaps a Proc: $: irb 01> s = lambda {|x| "This is #{x}" } --> # 02> s.call 1 --> "This is 1" 03> s.call 2 --> "This is 2" HTH. lasitha.