Question: What is the equivalent in C# for Delphi's in syntax, like:

```

  if (iIntVar in [2,96]) then 
  begin
    //some code
  end;

```

Thanks

Answer: 
To expand upon what Mason Wheeler wrote in a comment, this would be HashSet<T>.Contains (under .NET 3.5).

```
int i = 96;
var set = new HashSet<int> { 2, 96 };

if (set.Contains(i))
{
   Console.WriteLine("Found!");
}

```
You could write an extension method

```
 public static bool In(this int value, int[] range)
    {
        return (value >= range[0] && value <= range[1]);
    }

```