取出一个字符在字符串出现的次数

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;

 

转自:http://zhidao.baidu.com/question/182085850.html

posted @ 2012-03-19 10:30  stma  阅读(127)  评论(0)    收藏  举报