【发布时间】:2015-01-16 08:52:34
【问题描述】:
Zed Shaw 的 Learn Ruby the Hard Way 第 9 章使用了三重双引号:
puts """
There's something going on here.
With the three double-quotes.
We'll be able to type as much as we like.
Even 4 lines if we want, or 5, or 6.
"""
我尝试用单双引号写同样的东西,它似乎工作正常。我不明白三重双引号和单双引号之间的区别。我错过了什么吗?
【问题讨论】:
-
听起来他把 Ruby 和 Python 搞混了。
-
也许 Zed 想的是小于号的三倍(heredocs)blog.jayfields.com/2006/12/…
标签: ruby string-literals