CSharp examples for System.Collections:ICollection
remove All element from one ICollection from another ICollection
using System.Collections; using System;//from w ww .j av a 2s. co m public class Main{ public static bool removeAll(ICollection set, ICollection coll) { foreach (object item in coll) { ((IList) set).Remove(item); } return true; } public static bool remove(IList collection, object value) { bool b = collection.Contains(value); if (b) collection.Remove(value); return b; } }