string str = "hello world";
string newstr=str.Replace("hello","");
MessageBox.Show(str);
MessageBox.Show(newstr);
注意的是string是要生成新的字符串的,原来的字符串保持不变.
string str = "hello world";
string newstr=str.Replace("hello","");
MessageBox.Show(str);
MessageBox.Show(newstr);
注意的是string是要生成新的字符串的,原来的字符串保持不变.

被折叠的 条评论
为什么被折叠?