Tuesday, June 16, 2009

Get Distinct value from an ArrayList

int[] Arr = { 1, 2, 1, 24, 25, 1, 5, 5, 8, 7, 96, 3, 8, 4, 12, 45, 8, 6, 9, 5 };
ArrayList Array = new ArrayList(Arr);
Hashtable ht = new Hashtable();
foreach (int item in Array)
ht[item] = null;
ArrayList AList = new ArrayList(ht.Keys);