Delete or Filter Duplicate Item From ArrayList

Wednesday, July 25, 2012
Avoid duplicate item i use a function , that will return a ArrayList also.
And the Function is like :

protected ArrayList RemoveDuplicate(ArrayList ArrList) 
    { 
        ArrayList list = new ArrayList();
        foreach (string item in ArrList)
        {
            if (!list.Contains(item))
            {
                list.Add(item);
            }
        }
        return list; 
    }

---this will return a filtred ArrayList.

0 comments:

Post a Comment