Thema: Delphi Filterproblem mit TTable

Einzelnen Beitrag anzeigen

marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#9

Re: Filterproblem mit TTable

  Alt 8. Dez 2006, 12:56
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
  Mit Zitat antworten Zitat