我该如何修改字典中的值?我想在循环字典时重新分配一个值给字典中的一个值,就像这样:
for (int i = 0; i < dtParams.Count; i++)
{
dtParams.Values.ElementAt(i).Replace("'", "''");
}
这里的dtParams
是我的Dictionary
。
我想要做类似于这样的操作:
string a = "car";
a = a.Replace("r","t");