List myList = GetListOfIntsFromSomewhere();
// This will filter out the list of ints that are > than 7, Where returns an
// IEnumerable so a call to ToList is required to convert back to a List.
List filteredList = myList.Where( x => x > 7).ToList();
how to filter a list in c#
using System;
using System.Collections.Generic;
var vals = new List {-1, -3, 0, 1, 3, 2, 9, -4};
List filtered = vals.FindAll(e => e > 0);
Console.WriteLine(string.Join(',', filtered));