Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Ruby中的双引号""和单引号有什么区别?''
""
''
据我所见,这似乎只是一种偏好选择,除非两者意外混合,否则功能没有变化,即"Some String'.
"Some String'
双引号内插。
单引号不,例如,
puts "Hi #{42+5}" => "Hi 47" puts 'Hi #{42+5}' => "Hi #{42+5}"