L
ljw1001
I'm reading a file using:
" str = 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.
" str = 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.