Delphi里面判断一个字符串在另一个字符串中出现的次数


本文整理自网络,侵删。

 
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 修改内存

cnpack sqlite tool 2.04

Delphi xe中泛型数组的使用范例

Delphi tdownloadurl下载网络文件

Delphi ado的事务处理例子

Delphi 网上获取北京时间idhttpserver and idhttp 使用 encoding utf8

Delphi xe5也可以开发 google glass应用

Delphi 删除cookies及上网记录

Delphi10.3模拟读取百度网页,并读取相关头部信息

Delphi下idhttp配合cookiemanager获取cookie

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...