rhaazy
unread,Nov 25, 2008, 1:08:08 PM11/25/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
static List<string> removeDuplicates(List<string> inputList)
{
Dictionary<string, int> uniqueStore = new Dictionary<string, int>();
List<string> finalList = new List<string>();
foreach (string currValue in inputList)
{
if (!uniqueStore.ContainsKey(currValue))
{
uniqueStore.Add(currValue, 0);
finalList.Add(currValue);
}
}
return finalList;
}
You may have to adjust this to meet your specific needs, but the
concept is simple enough to demonstrate.
You need to create a new list of the same type and asign it the value
of what is returned from the removeDuplicates function.
> > WITH REGARDS- Hide quoted text -
>
> - Show quoted text -