自己写循环过程 ... var a:char; b:string; i:integer; begin for i := 0 to length(b) do begin if a=string[i] then messagebox(handle, '...','第'+inttostr(i+1)+'个字符',mb_ok +mb_iconinformation); end; end;
i := Pos(Substr,S); if i =0 then // 字符不在字符串中 i就是字符在字符串中出现的第一个位置.
if i =0 then
// 字符不在字符串中
i就是字符在字符串中出现的第一个位置.
这对你学习会有好处。英文不好看,但有时得慢慢看!
...
var a:char;
b:string;
i:integer;
begin
for i := 0 to length(b) do
begin
if a=string[i] then
messagebox(handle, '...','第'+inttostr(i+1)+'个字符',mb_ok +mb_iconinformation);
end;
end;
if i =0 then
// 字符不在字符串中
i就是字符在字符串中出现的第一个位置.