for i := 1 to 3 do STR := Trim(Copy(STR, Pos(' ', STR), Length(STR))); STR := Copy(STR, 1, Pos(' ', STR) - 1);
s1:string; line:string; s:strings; lineposition,currentposition,len:integer; s:=tstringlist.create; s.loadfrom('文本文件'); lineposition:=0; whild lineposition<s.count do begin currentposition:=1;len:=length(s[lineposition]);line:=' '; while currentposition<len do begin while s[lineposition][currentposition]=' ' do inc(currentposition); whild ss[lineposition][currentposition]<>' ' do begin line:=line+s[lineposition][currentposition]; inc(currentposition); end; if trim(line)'='500' then showmessage('found'); end; s.free; 在网吧,不知s.count是否正确,但strings有类似的属性!
STR := Trim(Copy(STR, Pos(' ', STR), Length(STR)));
STR := Copy(STR, 1, Pos(' ', STR) - 1);
line:string;
s:strings;
lineposition,currentposition,len:integer;
s:=tstringlist.create;
s.loadfrom('文本文件');
lineposition:=0;
whild lineposition<s.count do
begin
currentposition:=1;len:=length(s[lineposition]);line:=' ';
while currentposition<len do
begin
while s[lineposition][currentposition]=' ' do inc(currentposition);
whild ss[lineposition][currentposition]<>' ' do
begin
line:=line+s[lineposition][currentposition];
inc(currentposition);
end;
if trim(line)'='500' then showmessage('found');
end;
s.free;
在网吧,不知s.count是否正确,但strings有类似的属性!
s2:='500';
s3:=strpos(Pchar(s1),PChar(s2));
s3:=copy(s3,1,length(s2));