If you're using C# 3.0 you can use linq, way better and way more elegant:
List<int> myList = GetListOfIntsFromSomewhere();
// This will filter out the list of ints that are > than 7, Where returns an
// IEnumerable<T> so a call to ToList is required to convert back to a List<T>.
List<int> filteredList = myList.Where( x => x > 7).ToList();
If you can't find the .Where
, that means you need to import using System.Linq;
at the top of your file.