What's the use of System.String.Copy in .NET?

前端 未结 8 981
误落风尘
误落风尘 2020-12-13 07:58

I\'m afraid that this is a very silly question, but I must be missing something.

Why might one want to use String.Copy(string)?

The documentation says the me

8条回答
  •  孤城傲影
    2020-12-13 08:56

    string a = "test";
    string b = a;
    //Object.ReferenceEquals(a,b) is true
    a += "more";
    //Object.ReferenceEquals(a,b) is now false !
    

    auto-change detection ?

提交回复
热议问题