I'm trying to read lines from a file that might contain something like:
Here is a line with a variable to interpolate: #{var}
Now when I read it in like:
var = 99
File.foreach("junk.rbt") {|line|
puts line
}
of course I get the same line in the file with the #{var} in it.
I'd like to get:
Here is a line with a variable to interpolate: 99
I suspect there must be a way to do this since using "" causes
interpolation, how can I get an existing String to interpolate itself?
Phil