From: Barry Abrams Date: 2007-05-09T06:36:59+09:00 Subject: string substitution Sorry if this question gets posted a lot. I'm unsure of the terminology, so my searches didn't come up with anything. I've got a block of html coming in from the database that looks like this:
#{@copy_1}
#{@copy_2}
#{@copy_3}
I'd like to replace the variables with another string, which contains just text. What's the syntax for something like this? I got gsub! to do one variable, but it didn't seem like it was the most efficient way to do it. Plus, I need to do multiple ones. -- Posted via http://www.ruby-forum.com/.