How can I change the value of a number of keys in a dictionary.
I have the following dictionary :
SortedDictionary<int,SortedDictionary<string,List<string>>>
I want to loop through this sorted dictionary and change the key to key+1 if the key value is greater than a certain amount.
As Jason said, you can't change the key of an existing dictionary entry. You'll have to remove/add using a new key like so:
You can use LINQ statment for it
If you don't mind recreating the dictionary, you could use a LINQ statment.
or
You need to remove the items and re-add them with their new key. Per MSDN: