s:='333,33434,343434,3434.........'; z:=pos(',',s) while z>0 do begin i:=i+1; if i=100 then showmessage(inttostr(z)); z:=pos(',',s) end;
var S: TStrings; begin S := TStringList.Create; S.DelimitedText := '1,23,456'; //S[99]; end;————————————————————————————————— 宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。 —————————————————————————————————
var S:string; i,n:integer; begin S;='333,33434,343434,3434.........'; n:=0; for i:=1 to 100 do begin n:=n+pos(S,','); S:=dalete(S,1,pos(S,',')); end;
var S:string; i,n:integer; begin S;='333,33434,343434,3434.........'; n:=0; for i:=1 to 100 do begin n:=n+pos(',',S); S:=dalete(S,1,pos(',',S)); end;
s:='333,33434,343434,3434.........'; z:=pos(',',s) while z>0 do begin i:=i+1; if i=100 then begin showmessage(inttostr(z)); exit; end; z:=pos(',',s) end;
s:='333,33434,343434,3434.........'; z:=ansipos(',',s) j:= length(s); while z>0 do begin i:=i+1; if i=100 then showmessage(inttostr(j - length(s))); s:=copy(s,i,length(s)-i); // z:=ansipos(',',s); end;
s:='333,33434,343434,3434.........'; z:=pos(',',s) while z>0 do begin i:=i+1; if i=100 then begin showmessage(inttostr(z)); exit; end; s1:=copy(s,z+1,length(trim(s))); z:=pos(',',s1) end;
s:=copy(s,z+1,length(s)-z); //
int i,js:='333,33434,343434,3434.........'; i := 0; j:=0; while i<100 do begin if (s[j] = ',') then i:=i+1; j:= j+1; end; showmessage(inttostr(j));
z:=pos(',',s)
while z>0 do
begin
i:=i+1;
if i=100 then showmessage(inttostr(z));
z:=pos(',',s)
end;
S: TStrings;
begin
S := TStringList.Create;
S.DelimitedText := '1,23,456';
//S[99];
end;—————————————————————————————————
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
—————————————————————————————————
S:string;
i,n:integer;
begin
S;='333,33434,343434,3434.........';
n:=0;
for i:=1 to 100 do
begin
n:=n+pos(S,',');
S:=dalete(S,1,pos(S,','));
end;
S:string;
i,n:integer;
begin
S;='333,33434,343434,3434.........';
n:=0;
for i:=1 to 100 do
begin
n:=n+pos(',',S);
S:=dalete(S,1,pos(',',S));
end;
z:=pos(',',s)
while z>0 do
begin
i:=i+1;
if i=100 then begin
showmessage(inttostr(z));
exit;
end;
z:=pos(',',s)
end;
z:=ansipos(',',s)
j:= length(s);
while z>0 do
begin
i:=i+1;
if i=100 then showmessage(inttostr(j - length(s)));
s:=copy(s,i,length(s)-i); //
z:=ansipos(',',s);
end;
z:=pos(',',s)
while z>0 do
begin
i:=i+1;
if i=100 then begin
showmessage(inttostr(z));
exit;
end;
s1:=copy(s,z+1,length(trim(s)));
z:=pos(',',s1)
end;
i := 0;
j:=0;
while i<100 do
begin
if (s[j] = ',') then i:=i+1;
j:= j+1;
end;
showmessage(inttostr(j));