I am wondering is there a better way to change a dictionary key, for example:
var dic = new Dictionary<string, int>();
dic.Add("a", 1);
and later on I decided to make key value pair to be ("b" , 1) , is it possible to just rename the key rather than add a new key value pair of ("b",1) and then remove "a" ?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…