【发布时间】:2010-03-01 23:10:01
【问题描述】:
我刚从“The Well-Grounded Rubyist”开始,他们给出了以下示例:
print "Hello. Please enter a Celsius value: "
print "The Fahrenheit equivalent is ", gets.to_i * 9 / 5 + 32, ".\n"
特别是,我正在查看第 2 行,他们似乎在其中使用逗号进行字符串连接。我假设 + 符号没有被使用,因为代码的 + 32 部分。但是,有人可以向我解释逗号实际上在做什么吗?
【问题讨论】:
标签: ruby string string-concatenation