考慮下面的代碼在C#多個容器相同的字符串:在C#中,確實在指向同一個位置
String a = "hello world";
List<String> ListA = new List<String>();
List<String> ListB = new List<String>();
ListA.Add(a);
ListB.Add(a);
我的問題是:在這兩個列表中的兩個字符串實際上是指向同在內存中的位置?換句話說,對於同一個字符串有多個容器的附加內存僅僅是關於引用(指針)而不是字符串的實際內存?
謝謝。
[string.Intern](https://msdn.microsoft.com/en-us/library/system.string.intern(v = vs.110).aspx) – Steve