Click here to Skip to main content
11,583,859 members (62,781 online)
Click here to Skip to main content

Tagged as

Convert ArrayList to a Generic List

, 23 Oct 2011 CPOL 5.5K 1
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 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();

License

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

Share

About the Author

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

You may also be interested in...

Comments and Discussions

 
Generalasfsfsfs Pin
Member 360013614-Nov-11 18:45
memberMember 360013614-Nov-11 18:45 
asfsfsfs

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 | Terms of Use | Mobile
Web04 | 2.8.150603.1 | Last Updated 23 Oct 2011
Article Copyright 2011 by Michael Freidgeim
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid