Remove Range from ICollection - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:ICollection

Description

Remove Range from ICollection

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System;//from w w  w . j av  a  2s  .c om
using PokemonGo.Bot.MVVMLightUtils;

public class Main{
        public static void RemoveRange<T>(this ICollection<T> source, IEnumerable<T> items)
        {
            foreach (var item in items)
            {
                source.Remove(item);
            }
        }
}

Related Tutorials