There is a collection:
List<string> str_list = new List<string>(); str_list.Add("string1"); str_list.Add("string1"); str_list.Add("string2"); str_list.Add("string3"); str_list.Add("string2"); It is necessary to delete the items under the indices: str_list[1] and str_list[3] .
Of course, I know that the collection has a RemoveAt method, but you can't do this with it:
str_list.RemoveAt(1); str_list.RemoveAt(3); Because after executing str_list.RemoveAt(1) [3] will be [2].
The value can not, so they can be repeated.
Is it possible to somehow immediately set the range for deleting items by index?