给你个函数:
function GetStrCount(s, sSub: string): Integer;
var
sTmp : string;
iLen, iLenSub : Integer;
begin
Result := 0;
iLen := Length(s);
iLenSub := Length(sSub);
if (iLen <= 0) or (iLenSub <= 0) or (iLen < iLenSub) then
Exit;
sTmp := StringReplace(s, sSub, '', [rfReplaceAll, rfIgnoreCase]);
Result := ( iLen - Length(sTmp) ) div iLenSub
end;