How would I check if a variable is one of a few values?
Where IN in Oracle it would read like
where strVar in ('A','H','X','Z')
without having to write
if (strVar == "A" || strVar == "H" || strVar == "X" || strVar =="Z")
editted to change variable name
This should be enough for you:
can use also
but
Containsworks also onC# 2.0, insteadAnyno.EDIT
As correctly pointed out @brendan, get rid of
varnamed variable, that isC#keyword, let’s avoid creating confusion.