本文整理自网络,侵删。
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 “invalid floating point operation.”错误的解决方法
Delphi2010中字符串汇编需要注意的一点,以及支持2010的aes加密库
dbgrid的cellclick事件,单击当前行记录的那一行时,不发生
更多相关阅读请进入《Delphi》频道 >>