What is the OR operator in an IF statement

前端 未结 11 774
轮回少年
轮回少年 2020-12-14 05:50

In C#, how do I specify OR:

if(this OR that) {do the other thing}

I couldn\'t find it in the help.

Update:

11条回答
  •  囚心锁ツ
    2020-12-14 06:35

    In the format for if

    if (this OR that) 
    

    this and that are expression not values. title == "aaaaa" is a valid expression. Also OR is not a valid construct in C#, you have to use ||.

提交回复
热议问题