Probiere es mal so:
Delphi-Quellcode:
function TForm1.CreateTypLists(fn: TFileName; cStart, sStop: Char): TStrings;
var
i, iStart, iStop: Integer;
s: String;
begin
Result := TStringList.Create;
Result.LoadFromFile(fn);
for i := Pred(Result.Count) downto 0 do
begin
iStart := Pos(cStart, Result[i]);
iStop := Pos(cStop, Result[i]);
if (iStart = 0) or (iStop < iStart) then
Result.Delete(i);
end;
end;
Getippt und nicht getestet.
marabu