111,120
社区成员
发帖
与我相关
我的任务
分享string str="1234456789";
str=str.Replace("5","5 "); string filename = @"c:\test.txt";
string s = File.ReadAllText(filename);
string r = Regex.Replace(s, @"[\t ]+", " ");
File.WriteAllText(filename, r); string str = "1234456789 123 456";
Regex reg = new Regex(@"\s+",RegexOptions.IgnorePatternWhitespace);
str=reg.Replace(str, " ");