From: Warren Brown Date: 2005-10-19T01:26:59+09:00 Subject: Re: Expression Interpolation from input "template string"? Peter, > What I don't know is how to get the interpolation to > work when the string is read from teh database as if : > > x = 'Hello, today is #{msgDate}' The easiest way to do this is to #eval() the string with quotes around it: irb(main):001:0* s = 'This is #{a} test.' => "This is \#{a} test." irb(main):002:0> a = 'one' => "one" irb(main):003:0> eval("\"#{s}\"") => "This is one test." If you're like me, you'll want to use a quoting method prettier than \" inside the string: irb(main):004:0> eval("%{#{s}}") => "This is one test." I hope this helps. - Warren Brown