本文整理自网络,侵删。
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;
相关阅读 >>
Delphi2010中字符串汇编需要注意的一点,以及支持2010的aes加密库
Delphi 中将tmemorystream转换为'string'
Delphi if语法,弹出提示框,不等于写法,判断是否为空
Delphi 分解时间 �cdecodedate、decodetime … decodedatetime …
更多相关阅读请进入《Delphi》频道 >>