现在的位置: 首页 > 综合 > 正文

System.Pos – 搜索子串的位置

2011年10月11日 ⁄ 综合 ⁄ 共 180字 ⁄ 字号 评论关闭
举例:

var
  ss,s: string;
  i: Integer;
begin
  ss := 'CodeGear Delphi 2007';
  s := 'Gear';
  i := Pos(s,ss);
  ShowMessage(IntToStr(i));  {5}

  s := '2008';
  i := Pos(s,ss);
  ShowMessage(IntToStr(i));  {0}
end;

System 单元下的公用函数目录


抱歉!评论已关闭.