Tuesday, September 6, 2011

Delete item from "Enumerable List"

While performing a delete operation on a "Enumerable List" always use "for" statement instead of "for each".
In for statement last from the last item in the list.
Example:

for(int index=tempList.count;index > 0;i--)
{
 //Delete logic here...................
}

No comments:

Post a Comment