Variables added to string problem?


#1

I was doing the 'th' challenge and ended up completing it but instead of printing my variables information it just printed #{user_input} to the console? Any similar problems or a solution? Thx in advance.
-Cade


#2

Can you post your code please?


#3

I was in the first few lessons, my code was;

name = "Cade"
puts 'Oh so your name is #{name}!'

Instead of printing: Oh so your name is Cade!
It Printed: Oh so your name is #{name}!
This problem has been happening every lesson since with trying to print variables.


#4

I think the problem is that you're using simple quotes instead of double quotes.


#5

Yes! I checked it and it worked! Thanks, but do you know why I have to use " instead of ' ?
I don't understand why.


#6

Well in Ruby it seems that double quotes allow special treatments inside the strings (like #{}) while single quotes prevent them.


#7

Thanks for helping me out! ;D


#11