List<string> final = new List<string>(); foreach (KeyValuePair<string, int> entry in sortDict) final.Add(entry.Key); final.RemoveAt(2); List<string> duplicate = final.ToList(); //string check = textbox1.Text; if (duplicate.Contains(check) == true) { int remove = Math.Max(0, final.Count - 27); final.RemoveRange(0, remove); int delete = Math.Max(0, duplicate.Count - 3); duplicate.RemoveRange(3, delete); // delete all the text in the string except check duplicate.AddRange(final); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)