string str = " dd d d ";
str = str.Trim();
string s = Regex.Replace(str, " {2,}", " ");
即:s
转载于:https://www.cnblogs.com/wupeiqi/p/3149692.html