How can I copy a Dictionary
to another new Dictionary
so that they are not the same object?
Assuming you mean you want them to be individual objects, and not references to the same object:
Dictionary d = new Dictionary();
Dictionary d2 = new Dictionary(d);
"so that they are not the same object."
Ambiguity abound - if you do actually want them to be references to the same object:
Dictionary d = new Dictionary();
Dictionary d2 = d;
(Changing either d
or d2
after the above will affect both)