标签: ruby string compare
我如何重新考虑这样的事情?
response = "yes" if response == "yes" or response == "y" puts "Do Something" end
答案 0 :(得分:4)
if %w(yes y).include?(response)
答案 1 :(得分:-1)
<强>示例强>
如果@response =='R'|| @response =='r'
如果您输入 OR ,则会显示错误