public void Trim(string name) { int index = Properties.LastIndexOf(name); Properties.RemoveRange(index + 1, Properties.Count - index - 1); }