private static Dictionary<string, int> _dics = new Dictionary<string, int>() ; public TestController() { if (_dics.Count == 0) { _dics.Add("test1", 1); _dics.Add("test2", 2); _dics.Add("test3", 3); _dics.Add("test4", 4); } } var removes = _dics.Select(s => s.Key).ToArray(); foreach (var item in removes) { _dics.Remove(item); }
Remove
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)