如何不用循环两本词典结合? [英] How to combine two dictionaries without looping?
本文介绍了如何不用循环两本词典结合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我型<的两个字典;在C#
;字符串对象过夜。
我怎么能复制一个Dictionary对象的其他所有内容不应用一个循环?
解决方案
VAR D3 = d1.Concat(D2).ToDictionary(X => x.Key,X => x.Value);
I have two dictionaries of type <string,object>
in C#.
How can I copy all the contents of one Dictionary object to the other without applying a loop?
解决方案
var d3 = d1.Concat(d2).ToDictionary(x => x.Key, x => x.Value);
这篇关于如何不用循环两本词典结合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文