解读Ruby中注释的使用方法
Ruby行内注释的代码在运行时被忽略。单行注释#字符开始,他们从#到行末如下: #!/usr/bin/ruby -w # This is a single line comment. puts Hello, Ruby! 上述程序执行时,会产生以下结果: Hello, Ruby! Ruby的多行注释 可以注释掉多行使用 =begin 和 =end 语法如下: #!/usr/bin/ruby -w puts Hello, Ruby! =begin This is a multiline comment and con spwan as many lines as you like
下载地址
用户评论