public void RemoveKeysStartsWith(string section, string startsWith, bool ignoreCase = true) { if (!ContainsSection(section)) return; List<string> removes = new List<string>(_content.Count); foreach (string key in _content[section].Keys) { if ((ignoreCase ? key.ToLower() : key).StartsWith((ignoreCase ? startsWith.ToLower() : startsWith))) { removes.Add(key); } } foreach (string key in removes) { _content[section].Remove(key); } }