以下有两个代码示例:
# 1 string str1 = "hello";
string str2 = str1; //reference to the same string
str1 = "bye"; //new string created
并且 #2
string str3 = "hello";
string str4 = (string)str3.Clone();//reference to the same string
str3 = "bye";//new string created
看起来它们是相同的,不是吗?那么使用Clone()有什么好处?你能给我一个例子,在哪些情况下我不能使用代码#1而要使用代码#2吗?