adding 2 hashtable
C#
3
Posts
3
Posters
0
Views
1
Watching
-
If there's no method for this, you can iterate over the Keys and use those to copy the values in.
Christian Graus Driven to the arms of OSX by Vista.
-
If you use .NET 3.5 then you can use the
Union
method:Dictionary<int,> dicA = new Dictionary<int,>(); dicA.Add(1, 10); dicA.Add(2, 20); dicA.Add(3, 30); Dictionary<int,> dicB = new Dictionary<int,>(); dicB.Add(3, 35); dicB.Add(4, 40); dicB.Add(5, 50); var newDic = dicA.Union(dicB);
regards