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";
标签:str string gpo pos strong ring UI stringbu post
StringBuilder与string的Replace方法的区别
标签:str string gpo pos strong ring UI stringbu post
原文地址:https://www.cnblogs.com/jayli/p/8371208.html