Enumerable.OfType<TResult>(IEnumerable) Method (System.Linq)

Filters the elements of an IEnumerable based on a specified type.