CSharp examples for System.Collections.Generic:List
Difference between two list
using System.Collections.Generic; using System.Collections; using System;/* w w w.java 2s . c o m*/ public class Main{ public static IList<T> DifferenceWith<T>(this IList<T> collection1, IList<T> collection2) { var difference = new List<T>(); foreach (T item1 in collection1) { if (!collection2.Contains(item1)) difference.Add(item1); } return difference; } }