SortedDictionary 将一个 SortedDictionary 添加到另一个中
我有一个要求,即我已经有一个现有的 SortedDictionary
。现在我正在创建一个不同的 SortedDictionary
并希望将其添加到第一个中。怎么做呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需将其传递给构造函数即可:
Just pass it to the constructor:
SortedDictionary
不提供AddRange(IEnumerable>)
函数,因此您必须努力做到这一点方式,一次一项。SortedDictionary<TKey,TValue>
doesn't provide anAddRange(IEnumerable<KeyValuePair<TKey, TValue>>)
function, so you'll have to do it the hard way, one item at a time.