//.net写法string str = "abcdefg";//字符串 str = str.Replace("cd","abc");//将字符串中的cd替换成abc //最终值str="ababcefg";