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: 
There is no such equivalent. The closest is the [Contains()](http://msdn.microsoft.com/en-us/library/bb352880.aspx) extension method of a collection. 

Example:

```
var vals = new int[] {2, 96};
if(vals.Contains(iIntVar))
{
  // some code
}

```
You could write an extension method

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

```