本文介绍了修改现有集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Sortedlist集合.在这种情况下,我想将一些值附加到现有键的值上.您能帮我吗?
例如:如果sortedlist [2] == true,则要将其他值附加到sortedlist [2]的值.
在此先感谢您,
Hi,
I have a Sortedlist Collection. In this i want to append some value to exsisting key''s value. Can you please help me on this?
e.g: if sortedlist[2] == true then want to append some other value to sortedlist[2]''s value.
Thanks in Advance,
推荐答案
foreach (DictionaryEntry item in sortedList)
{
if(item.Value == "[something]")
{
sortedList[item.Key] = item.Value + "[appendsomething]";
}
}
这篇关于修改现有集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!