第1个回答 2010-09-08
function stringn(s1,s2:string):integer
begin
result:=0;
while pos(s1,s2)>=0 do
begin
s2:=copy(s2,pos(s1,s2)+1,9999); //假设s2最大长度为9999个字符
result:=result+1 ;
end;
end;本回答被提问者采纳
第2个回答 推荐于2018-05-13
function StrPosCount(subs:string;source:string):integer;
var
Str : string;
begin
Result := 0;
str := source;
while Pos(Subs,Str)<>0 do
begin
Delete(Str,Pos(Subs,Str),Length(Subs));
Inc(Result);
end;
end;本回答被网友采纳