Search code examples
rubyirb

Why doesn't "Hello #{#'world'}" return anything?


My IRB console output.

1.9.3p385 :005 > "Hello #{#'world'}"
1.9.3p385 :006 > 

Shouldn't this return Hello? What is that happening? Is this an error?


Solution

  • You need to remove the second "#" character. That is making the rest of the line a comment. Therefore, it is not a complete line.

    "Hello #{'world'}"