C#C
C#3y ago
Groophy

✅ Simple question

I have a code which
if ("any" is "item1" or "item2" or "any")
{
    Console.WriteLine("okay");
}

that prints okay but out of curiosity, can I do this with symbols? like
if ("any" == "item1" || "item2" || "any") // "any" == "item1" || "any" == "item2" will be corrent but really bad readable
{
    Console.WriteLine("okay");
}
Was this page helpful?