C# subtracting one list from another or checking if one list is completly containt in another list
问题 How to subtract one list from another? List<string> l1 = new List<string> { "abc", "abc", "abc", "def" }; List<string> l2 = new List<string> { "abc" }; var r = l1.Except(l2).ToList(); Doing this results in r => "def" instead of r=> "abc", "abc", "def". I mean, the second list only contains "abc" one time. So I want to remove only one instance of "abc" of the first list. Btw: Is there a way to check if one list is completely contained in another list? Meaning when list1 only contains "abc" one