有很多与此类似的问题,但我认为没有一个真正有我需要的答案。
据我所知,任何有#
前面的东西都会变成评论,如:
puts "not a comment"
# puts "in a comment"
但是当谈到字符串插值时,你可以说:
puts "time is #{Time.now}"
并且#
at#{Time.now}
不会开始评论它之后写的任何内容。
怎么会这样?
有很多与此类似的问题,但我认为没有一个真正有我需要的答案。
据我所知,任何有#
前面的东西都会变成评论,如:
puts "not a comment"
# puts "in a comment"
但是当谈到字符串插值时,你可以说:
puts "time is #{Time.now}"
并且#
at#{Time.now}
不会开始评论它之后写的任何内容。
怎么会这样?