C
C#3d ago
MTMB

✅ What is the `or` operator called?

I'm tryna find docs for the or operator. Is it any different to ||? Whenever I try to search for it then it just comes up with ||, and its not listed here: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/ When I use it like this it seems to run against both things?
string name = "bob";
Console.WriteLine(name is "bob" or "alice");
string name = "bob";
Console.WriteLine(name is "bob" or "alice");
6 Replies
MTMB
MTMBOP3d ago
thanks bro
ero
ero3d ago
$close unless you have further questions
MODiX
MODiX3d ago
If you have no further questions, please use /close to mark the forum thread as answered
MTMB
MTMBOP3d ago
$close
MODiX
MODiX3d ago
If you have no further questions, please use /close to mark the forum thread as answered

Did you find this page helpful?