C# Comparison shorthand
- by TheAdamGaskins
I have this code:
if (y == a && y == b && y == c && y == d ...)
{
...
}
Is there some form of shorthand so that I can rewrite it as something like this?
if(y == (a && b && c && d ...))
{
...
}
The functionality should be exactly the same. I'm just looking for something that looks less confusing.
EDIT Sorry for not clarifying, all the variables are integers. I'm looking for a shorter way to ensure that a, b, c, d, ... all equal y.