Remove Range IDictionary - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:IDictionary

Description

Remove Range IDictionary

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//  w w w  . j  a  va  2 s .com

public class Main{
        public static void RemoveRange<TKey, TValue>(this IDictionary<TKey, TValue> _this, IEnumerable<TKey> keys)
        {
            Check.NotNull(_this);
            if (keys == null)
                return;

            foreach (TKey key in keys)
            {
                _this.Remove(key);
            }
        }
}

Related Tutorials