mardi 2 août 2016

Does the 'or' operator in C# mean "and/or" or "one or the other"?

this is a very simple question but I would like some clarification to be sure.

Take the following example:

if (FirstName == "Bert" || Surname == "Berterson")

Does the || (or) operator mean, in this case:

A. "If the person is named Bert and/or has the surname Berterson" (i.e. "Bert Berterson", "Bert Smith", "Gary Berterson" would all qualify)

-- or --

B. "If the person has either the first name Bert or the surname Berterson but not both" (i.e. "Bert Berterson" would not qualify while "Sally Berterson" and "Bert Billhouse" will qualify)

Thank you for you time, I hope this makes sense and apologies for such a simple question

Aucun commentaire:

Enregistrer un commentaire