111,119
社区成员
发帖
与我相关
我的任务
分享
string ResultString = null;
string SubjectString = "abc de fg hij klm no p qrs t uv wxyz";
try
{
ResultString = Regex.Replace(SubjectString, "\\s{2,}", "");
}
catch (ArgumentException ex)
{
}
string ResultString = null;
string SubjectString = "abc de fg hij klm no p qrs t uv wxyz";
try
{
ResultString = Regex.Replace(SubjectString, "\\s{2,}", " ");
}
catch (ArgumentException ex)
{
}string ResultString = null;
string SubjectString = "abc de fg hij klm no p qrs t uv wxyz";
try {
ResultString = Regex.Replace(SubjectString, "\\s{2,}", " ");
} catch (ArgumentException ex) {
}
string s = "abc de fg hij klm no p qrs t uv w xyz";
s = Regex.Replace(s, @"[\s]{2,}", "");
string ResultString = null;
string SubjectString = "abc de fg hij klm no p qrs t uv wxyz";
try {
ResultString = Regex.Replace(SubjectString, "\\s{2,}", " ");
} catch (ArgumentException ex) {
}