字符串操作 要注意的一点

            string str = "hello world";
            string newstr=str.Replace("hello","");
            MessageBox.Show(str);
            MessageBox.Show(newstr); 

 

注意的是string是要生成新的字符串的,原来的字符串保持不变.

你可能感兴趣的:(String)