0

I'm trying to compare two strings using this code in a switch statement:

case "medStepOne":
WebEligibilityMedFirst.SelectOptions(p0);
    if (!p0.Equals("failOne") || !p0.Equals("failTwo") || !p0.Equals("failThree") || !p0.Equals("failFour"))
       {
           WebEligibilityMedSecond.SelectOptions(p0);
        }
break;

The string is definitely "failOne" so I believe that the code should bypass the if statement but it does not.

1 Answer 1

0

Embarrassingly, I saw the problem pretty much as soon as I'd re-read it to make sure I'd asked it correctly. I need && instead of ||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.