假设我的字符串是:
"The fox jumped over the log."
然后应该变成:
"The fox jumped over the log."
在不循环和拆分字符串的情况下实现此目的最简单的(1-3 行)是什么?
无循环:
Result := StringReplace(StringReplace(S, ' ', ' ', [rfReplaceAll]), ' ', ' ', [rfReplaceAll]);
说明:
替代方案(未经测试):
Result := String.SplitString(S, ' ').Join(' ');