Sorry, hier ein Nachschlag:
Delphi-Quellcode:
function CompactStr(const s: String; c: Char = ' '): String;
var
i, iDel: Integer;
begin
Result := s;
iDel := 0;
for i := 1 to Length(s) do
if (i > 1) and (s[i] = c) and (s[Pred(i)] = c)
then Inc(iDel)
else Result[i - iDel] := s[i];
SetLength(Result, Length(s) - iDel);
end;
Grüße