BEGroup.Utility.IniFile.RemoveKeysStartsWith C# (CSharp) Метод

RemoveKeysStartsWith() публичный Метод

Removes all key/value pairs that with the key starts with the specified string in the specified section.
public RemoveKeysStartsWith ( string section, string startsWith, bool ignoreCase = true ) : void
section string Section name
startsWith string Starts with string
ignoreCase bool true to ignore case; otherwise false
Результат void
        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);
            }
        }