如何“如果在其他具有不同值的变量上正确使用”

时间:2019-04-19 03:04:41

标签: c# variables if-statement

我有一条if-else语句,如果两个变量具有相同的值,它将不会运行。但是,如果这两个变量都为“ 0”,它将运行。

if (a != b){
     //it should also proceed here if a and b are both "0". What should my statement be?
}

1 个答案:

答案 0 :(得分:2)

I've solved it guys. Thank you.

if (a != b || (a == "0" && b == "0")){
   //it should also proceed here if a and b are both "0". What should my statement be?
}