converting hashtable.values to arrayList

  • Thread starter Thread starter macky caliston
  • Start date Start date
macky said:
Hi,

How can I convert hashtable.Values to an ArrayList?

Thanks a Lot,

Macky

You can't.

You can create a new ArrayList and copy the items from the collection to it:

ArrayList newList = new ArrayList(someHashTable.Values);

Unless you are stuck with framework 1.x, I suggest that you use generic
lists and dictionaries instead of ArrayList and HashTable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top