Home  >  Q&A  >  body text

基础 - Ruby中"?"运算符的使用

 if next_move.include? "0" or next_move.include? "1"
     xxxxxxx
 end

在笨办法学Ruby中看到这里不太明白

黄舟黄舟2758 days ago916

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-04-25 09:04:28

    is not an operator. The ? in ruby ​​can be used in function names to indicate a judgment. For example, include? means whether to include

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-04-25 09:04:28

    Convention in ruby?结束的方法名返回值是true/false

    reply
    0
  • Cancelreply