Consider the code snippet below
if(a == x || a == y || a == z)We can re-write this expression as:
- Using array's contains
- Using a similar syntax for the SQL's IN operator by using extension
return collection.Contains(obj);
}
And invoke as
if(a.IsIn(b, c, d)) { ... }
Read more at Stackoverflow
No comments:
Post a Comment