小编mus*_*dan的帖子

红宝石中的斜杠有什么作用

当我在Ruby的某些代码块的开头和结尾放置斜杠时,它们的行为就像注释。这是为什么?

puts "hello"
/
puts "world"
/
puts "peace"
Run Code Online (Sandbox Code Playgroud)

输出值

hello
peace
Run Code Online (Sandbox Code Playgroud)

ruby comments slash

3
推荐指数
1
解决办法
38
查看次数

标签 统计

comments ×1

ruby ×1

slash ×1