65.9K
CodeProject is changing. Read more.
Home

Convert ArrayList to a Generic List

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.67/5 (2 votes)

Oct 23, 2011

CPOL
viewsIcon

27483

You can filter all elements of arrayList that can be cast to the same type using Enumerable.OfType(Of TResult) Method[^]. List typedList = arrayList.OfType().ToList();

You can filter all elements of arrayList that can be cast to the same type using Enumerable.OfType(Of TResult) Method[^].
List<myclass> typedList = arrayList.OfType<myclass>().ToList();