C#把字符串中间多余的空格去掉,只保留一个空格

string  str =  "hello  my sister   Helen" ;
 

str = System.Text.RegularExpressions.Regex.Replace(str, @"\b\s+\b"" ");


转载自:https://zhidao.baidu.com/question/1432688421657139779.html

猜你喜欢

转载自blog.csdn.net/qq736150416/article/details/80326441
今日推荐