.net - How do I copy the content of a dictionary to an new dictionary in C#? -


how can copy dictionary<string, string> new dictionary<string, string> not same object?

assuming mean want them individual objects, , not references same object:

dictionary<string, string> d = new dictionary<string, string>(); dictionary<string, string> d2 = new dictionary<string, string>(d); 

"so dont same object."

ambiguity abound - if want them references same object:

dictionary<string, string> d = new dictionary<string, string>(); dictionary<string, string> d2 = d; 

(changing either d or d2 after above affect both)


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -