2
Answers

LIst collection item not removes

Dharmendra Singh

Dharmendra Singh

11y
1.2k
1
Suppose I have two list likes..
List<int> list1={1,2,3,4,5};
List<int> list2={2,3,4};
now i want result in third list like..
List<int> list3={1,5};

I have use


foreach (var t in purchaseResult)
                {
                    for (int counter = 0; counter < poRecive.Count; counter++)
                    {
                        if (t.RecNo == poRecive[counter].RecNo)
                        {
                            poRecive.Remove(t);
                        }
                    }                
                }


but this code not removes data....
Answers (2)