Subtract a generic list from another

前端 未结 6 819
天涯浪人
天涯浪人 2020-12-13 23:02

I am trying remove a list of firmIDs from one list from another. I don\'t really understand linq but I am pretty sure I need to use it.

List firm         


        
6条回答
  •  隐瞒了意图╮
    2020-12-13 23:39

    If you have list X and a list Y, and you want to remove all items in Y that are in X you can experiment with the following:

    X.Intersect(Y)

    Comparing two Lists and returning the distinct values and the differences

提交回复
热议问题