What is the OR operator in an IF statement

前端 未结 11 855
轮回少年
轮回少年 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:31

    Or is ||

    And is &&

    Update for changed question:

    You need to specify what you are comparing against in each logical section of the if statement.

    if (title == "User greeting" || title == "User name") 
    {
        // do stuff
    }
    

提交回复
热议问题