本文整理自网络,侵删。
function SubStrConut(mStr: string; mSub: string): Integer;{ 返回子字符串出现的次数 }begin Result := (Length(mStr) - Length(StringReplace(mStr, mSub, '', [rfReplaceAll]))) div Length(mSub);end; { SubStrConut }
procedure TForm1.Button1Click(Sender: TObject);begin Caption := IntToStr(SubStrConut(Edit1.Text, Edit2.Text));end;
相关阅读 >>
Delphi 网上获取北京时间idhttpserver and idhttp 使用 encoding utf8
Delphi xe5也可以开发 google glass应用
Delphi下idhttp配合cookiemanager获取cookie
更多相关阅读请进入《Delphi》频道 >>