string str1= "1,2,3,4,5,6,7"; string result = Regex.Replace(str1, ",", "",RegexOptions.None); result="1234567"; 标记一下 C#替换制定字符