Rudebox.co.nr How To Forums

Rudebox How To Forums - Ask Anything, View How To's
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in

Share | 
 

 Generic List. Remove duplicate

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin
avatar

Number of posts : 216
Registration date : 2007-01-01

PostSubject: Generic List. Remove duplicate   Wed Nov 07, 2007 6:00 pm

Source : http://www.thescripts.com/forum/thread646397.html


Slightly 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;

}
Back to top Go down
View user profile http://rudebox.editboard.com
 
Generic List. Remove duplicate
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Inquisition list (1750)
» 1000 pt Eldar list
» 1850 Necron List
» Thoughts on a mobile Tau list 1850 points
» tau 1k list tourney list

Permissions in this forum:You cannot reply to topics in this forum
Rudebox.co.nr How To Forums :: How To - Programming-
Jump to: