I'm messing around with Ruby and I'm trying to understand how the #{} operation works.
b = "puts \'Hello World\'"
r = "Testing .... #{b}"
When running this code, nothing its printed to the screen.
However this does print to the screen
b = "puts \'Hello World\'"
r = "Testing .... #{puts 'Hello World'}"
Why does the 2nd example print to the screen and the first doesn't.
Thanks
"puts 'Hello World'"vs.puts 'Hello World'. Sure, both programs containputs, but in one of them it’s code and in the other it’s just part of a string literal.