0
why object.ReferenceEquals(u, c)=false
class Program { static void Main(string[] args) { string a = "len"; string b = "len"; string c = new StringBuilder(a).ToString(); Console.WriteLine(c); Console.WriteLine(object.ReferenceEquals(a,c)); string u = string.Intern(c); Console.WriteLine(object.ReferenceEquals(u, c)); Console.ReadKey(); } }
2 Respostas
0
because they are different when you use string.intern
0
but they have same value and interning says produce new string with this reference why c cant be reference in this satiation