有没有办法改变索引元素的值而不像这样删除它?
// Dictionary<?,int> runningcount = …;
int value = runningcount[city];
runningcount.Remove(city);
runningcount.Add(city, ++value);
有没有办法改变索引元素的值而不像这样删除它?
// Dictionary<?,int> runningcount = …;
int value = runningcount[city];
runningcount.Remove(city);
runningcount.Add(city, ++value);