function FilterAscii(const AString: string): string;
var
i: Integer;
s: string;
begin
Result := AString;
if (Length(AString) < 1) then
Exit;
s := '';
for i := 1 to Length(AString) do
if ((Ord(AString[i]) > 31) and (Ord(AString[i]) < 127)) then
s := s + AString[i];
Result := s;
end;
function DelDoubleSpace(const AString: string): string;
var
s: string;
p: Integer;
begin
Result := AString;
if (Length(AString) < 2) then
Exit;
s := AString;
repeat
p := Pos(' ', s);
if (p > 0) then
Delete(s, p, 1);
until p = 0;
Result := s;
end;
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
const
s = String('*M1 uses ... actnlist; public property TCustomActionList.ActionCount: Integer read GetActionCount;');
begin
Memo1.Text := DelDoubleSpace(FilterAscii(s));
end;