Tag: 语言不可知

更快的if语句:如果`variable`是“value”或“value”

你怎么能在一个论点中与多种可能性进行比较? 例: if ((integer == 2) || (integer == 5)) if ((string == "hello") || (string == "dolly)) 如果你能写这样的话,会节省很多代码: if (integer == (2 || 5)) if (string == ("hello" || "dolly"))