Is there a shortcut for the following evaluation? One where I do not need to specify value a twice?
(a && b || a && c)
Thank you. :)
CodePudding user response:
This should work for you:
(a && (b || c))
CodePudding user response:
If the condition with braces isn't clear enough for you:
switch (a)
{
case true when b || c:
Console.WriteLine($"{a} | {b} | {c}");
break;
default:
Console.WriteLine("Nope!");
break;
}