Skip to content

Instantly share code, notes, and snippets.

@ivey
Created October 10, 2009 02:41
Show Gist options
  • Save ivey/206535 to your computer and use it in GitHub Desktop.
Save ivey/206535 to your computer and use it in GitHub Desktop.
irb(main):005:0> str = 'foo #{bar} baz'
=> "foo \#{bar} baz"
irb(main):006:0> bar = 2
=> 2
irb(main):007:0> Kernel.eval '"' + str + '"'
=> "foo 2 baz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment