Jam*_*urz 11
var s = "This is a string with multiple white space";
Regex.Replace(s, @"\s+", " "); // "This is a string with multiple white space"
Run Code Online (Sandbox Code Playgroud)
Regex r = new Regex(@"\s+");
string stripped = r.Replace("Too many spaces", " ");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3234 次 |
| 最近记录: |