Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Convert ArrayList to a Generic List

By , 23 Oct 2011
Rate this:
Please Sign up or sign in to vote.
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();


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Michael Freidgeim
Software Developer (Senior)
Australia Australia
No Biography provided

Comments and Discussions

Generaldadadadada PinmemberMember 360013614-Nov-11 18:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 23 Oct 2011
Article Copyright 2011 by Michael Freidgeim
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid