StringBuilder的Replace方法会更改对象本身的值,例StringBuilder s1="1234";s1.Replace("4","5");s1的值为"1235";
string的Replace方法不会更改对象本身的值,例string s1="1234";string s2=s1.Replace("4","5");s1的值仍然为"1234";s2的值为"1235";
原文地址:https://www.cnblogs.com/jayli/p/8371208.html
时间: 2024-10-12 16:04:31