var
MyList: TStringList;
Index: Integer;
begin
MyList := TStringList.Create;
try
MyList.LoadFromFile('Myfile.txt');
MyList.Sort;
if MyList.Find('MyStr', Index) then
...
end;
finally
MyList.Free;
end;
MyList: TStringList;
Index: Integer;
begin
MyList := TStringList.Create;
try
MyList.LoadFromFile('Myfile.txt');
MyList.Sort;
if MyList.Find('MyStr', Index) then
...
end;
finally
MyList.Free;
end;
http://renzhm.home.sohu.com/programme/delphi/d0019.htm
result:=pos('YourSubString',stringlist.text);