How to remove the contents of one list from another list?
list1.RemoveAll(i => list2.Contains(i));
List<object> result = anotherlist.Except(list).ToList();
Here's a quick summary and tip by James post.
If you use List<T>, but myOtherListcontains many elements, you must convert it to Hashset<T> var set = new Hashset(myOtherList), so its solution should be much faster.
List<T>
myOtherList
Hashset<T>
var set = new Hashset(myOtherList)
Source: https://habr.com/ru/post/1745767/More articles:Beanshell equivalent for .Net - .netdisable specific URL in robots.txt file - robots.txtChoosing the right structure - frameworksRemoving a node from a linked list in C - cDisplay after deletion in a linked list in C - cParse NTFS partition in C - cMSDN Security Descriptors Note - windowsScreen Scraping - как получить отфильтрованные данные на основе AJAX - asp.netПочему некоторые языки не используют точки с запятой и фигурные скобки? - programming-languagesHow does CouchDB perform for a regularly updated dataset? - performanceAll Articles