(Gast)
n/a Beiträge
|
Re: Stringverarbeitung - Leerzeichen reduzieren
12. Sep 2008, 16:40
Hallo,
wär' das was?
Delphi-Quellcode:
function DeleteBlanksFromStr(const AString: string): string;
Var
i : Integer;
iLen : Integer;
iPos : Integer;
s : String;
begin
s := Trim(AString);
iPos := Pos(' ',s);
if iPos = 0 then begin
Result := s;
exit;
end;
iLen := Length(s);
Result := Copy(s,1,iPos - 1);
for i := iPos to iLen do begin
case s[i - 1] of
' ' : case s[i] of
' ' : ;
else
Result := Result + s[i];
end;
else
Result := Result + s[i];
end;
end;
end;
Stephan
|
|
Zitat
|