Zac*_*ese 1 ruby string string-concatenation
我刚刚开始使用"The Well-Grounded Rubyist",他们给出了以下示例:
print "Hello. Please enter a Celsius value: "
print "The Fahrenheit equivalent is ", gets.to_i * 9 / 5 + 32, ".\n"
Run Code Online (Sandbox Code Playgroud)
特别是,我正在看第2行,他们似乎在使用逗号进行字符串连接.我假设+因为+ 32代码的一部分而没有使用该符号.但是,有人可以向我解释一下逗号究竟在做什么吗?
| 归档时间: |
|
| 查看次数: |
441 次 |
| 最近记录: |