1、去掉不固定的空格数量
string inputString = @"Sail Date: Saturday, Jun 23, 2018 from Miami, United States";
输出 = new System.Text.RegularExpressions.Regex("[\\s]+").Replace(inputString, " ");结果 = "Sail Date: Saturday, Jun 23, 2018 from Miami, United States"
本文共 298 字,大约阅读时间需要 1 分钟。
1、去掉不固定的空格数量
string inputString = @"Sail Date: Saturday, Jun 23, 2018 from Miami, United States";
输出 = new System.Text.RegularExpressions.Regex("[\\s]+").Replace(inputString, " ");结果 = "Sail Date: Saturday, Jun 23, 2018 from Miami, United States"
转载于:https://www.cnblogs.com/honzhez/p/6610339.html