如何从vb中的SortedList替换键和值的索引

时间:2020-04-11 08:54:52

标签: sortedlist

有SetByIndex方法可用于SortedList,它仅替换值,但我也想替换键。 请帮我做 这是我的示例代码

Dim sortedNames As SortedList = New SortedList()
sortedNames.Add("BBB",35)
sortedNames.Add("AAA",34)
sortedNames.Add("CCC",36)
sortedNames.Add("DDD",37)

so finally I am getting the sorted list here like this
Index  Key   Value
1     "AAA"  34
2     "BBB"  35
3     "CCC"  36
4     "DDD"  37```

Now,my requirement is I want to bring up ("CCC",36) at index 1
Using SetByIndex it only replace the value but i want both at index 1
How to do that?

0 个答案:

没有答案
相关问题