Created
January 21, 2015 21:34
-
-
Save sixtyfive/efafe7b9118af8150198 to your computer and use it in GitHub Desktop.
Thing with strings and Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mystring = "something" | |
puts mystring | |
=> "something" # okay, so far so good | |
foobar = "test" | |
mystring = '#{foobar}' # note the single quotation marks! | |
puts mystring | |
=> "#{foobar}" # not what i want | |
puts eval mystring | |
=> nil # not what i want, either | |
=> "test" # <= this is what i wish to get back somehow... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment