From: sanha lee Date: 2005-11-28T13:58:30+09:00 Subject: Re: string substitution question ------=_Part_44197_10902424.1133153901098 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I am not sure, but how about use eval function maybe like this eval(%Q(puts #{str})) I want it work. let me know that. good luck On 11/28/05, ljw1001@gmail.com wrote: > > I'm reading a file using: > > " str =3D IO.read("textfile1.txt") " > > and trying to output the results using > > " puts str " > The problem is that I want to substitute values in the file. It > includes this text: #{(3+4).to_s} > > I expected the puts statement to output 7, but it outputs the code > literally as #{(3+4).to_s} > > How can i get this substitution to happen? > > thanks for your help. > > > ------=_Part_44197_10902424.1133153901098--