.NET Fiddle

CSharp · Console

/Program.cs

using System;
// Allows use of extension methods from the System.Linq namespace
using System.Linq; 

public class Program
{
    public static void Main()
    {
        var ints = new int[] {1, 2, 3, 4};

        // Call Where() extension method from the System.Linq namespace
        var even = ints.Where(x => x % 2 == 0); 
		
		// Output the results
		Console.WriteLine(String.Join(",",even));
    }
}
;