我开始学习
Ruby,需要一些帮助包括?方法.
x = 'ab.c' if x.include? "." puts 'hello' else puts 'no' end
但是当我这样编码的时候:@H_403_3@
x = 'ab.c' y = 'xyz' if x.include? "." || y.include? "." puts 'hello' else puts 'no' end
test.rb:3: Syntax error,unexpected tSTRING_BEG,expecting keyword_then or ';' o r '\n' if x.include? "." || y.include? "." ^ test.rb:5: Syntax error,unexpected keyword_else,expecting end-of-input
这是因为包括吗?方法不能有句柄逻辑运算符?@H_403_3@
谢谢@H_403_3@