作者:admin 来源: 日期:2020/10/17 14:42:54 人气: 标签:
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;