In my OrderedDictionary
I want to replace an object. I saw that the OrderedDictionary
has a method called Insert()
. So, I thought when I get the index of the object I want to replace, I remove that object with RemoveAt()
and then insert the new object with the Insert()
method.
But... I need to figure out what the index is of the object I want to replace. Should I simply use a for loop or is there a better way?
Some background information: This piece of code is put into a method. And the method can be called multiple times in a for loop in another method.