there is a string like this and it is stored in a file
#{date}abcde.doc
I want to be able to read this string and replace #{date} with
Date.today.strftime("%Y%m%d")
Is there any way to parse the template and do the evaluation? Thanks in advance!
Yes, however…
It would be easier if you used hash replacement, like this:
Or just use ERb.
As-is you’re using string interpolation so it would need to be evaled, I think.