I was in Ruby recently and came from Python, where single and double quotes didn't matter how the code worked, as far as I know.
I moved to Ruby to see how it works and to explore the similarities between Ruby and Python.
I used single-frame strings once and noticed this:
hello = 'hello'
x = '
puts x
He returned '#{hello} world!'
, not 'hello world!'
.
Noticing this, I tried double quotes and the problem was fixed. Now I'm not sure why this is so.
Have single and double quotes changed or is it because of my editor (Sublime text 3)? I also use Ruby version 2.0 if it works differently in previous versions.
source
share