In a lot of situations we have to do something like this:
if (someVariable == value1 || someVariable == value2 || someVariable == value1...)
Would it be nice if we can do this in following manner:
if (someVariable in {value1, value2, value3...}
We can do this
int[] arr = {value1, value2, value3....};
if (arr.Contains(someVariable)) ...
But its still overwhelming, to my opinion. Why there isn’t a support for this syntax, or there is but I don’t know about it?
I think this may be about as concise as you may get: