What is the difference between double quotation marks ""
and single quotation marks ''
in Ruby?
As far as I have seen this seems to only be a choice of preference and there is no change in function unless the two are accidentally mixed, ie "Some String'
.
Double-quotes interpolates.
Single-quotes do not, e.g.,
puts "Hi #{42+5}"
=> "Hi 47"
puts 'Hi #{42+5}'
=> "Hi #{42+5}"