Admin Admin
Number of posts : 216 Registration date : 2007-01-01
| Subject: Generic List. Remove duplicate Wed Nov 07, 2007 6:00 pm | |
| Source : http://www.thescripts.com/forum/thread646397.htmlSlightly modified Version Create List - Code:
-
void CreateList {
//Create/Get List
list.sort(); list.RemoveAll(RemoveDuplicate); }
Removing Duplicates Function - Code:
-
private static Object temp; private static bool RemoveDuplicate(Object currentMode) { bool isDuplicate; if (temp == currentMode) { isDuplicate = true; } else { isDuplicate = false; } temp = currentMode; return isDuplicate;
} | |
|