本文整理自网络,侵删。
function MyPos(const SubStr,S:string): integer;
var
I:integer;
begin
Result:=0;
for I:=1 to Length(S)-Length(SubStr)+1 do
if CompareMem(@S[I], @SubStr[1],Length(SubStr)) then
Result:=Result+ 1;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if MyPos('E',Edit1.Text)>0 then
begin
showmessage('存在');
end;
end;
相关阅读 >>
Delphi 让嵌入窗体的 webbrowser 控件无边框
更多相关阅读请进入《Delphi》频道 >>