Sunday, November 8, 2015

Remove duplicate from list c#




list.Sort();  
Int32 index = 0;  
while (index < list.Count - 1)  
{  
if (list[index] == list[index + 1])  
list.RemoveAt(index); 
        else index++; 
}

No comments:

Post a Comment