如果字串'***'不在str中,Pos()函数返回0值。

解决方案 »

  1.   

    楼上都说了
    if Pos('***',str)>0 then
    begin
      //大于0就是str中包含了'***'这个字符串,等于0不包含
    end else
    begin
      //
    end;
      

  2.   

    function Pos(Substr: string; S: string): Integer;DescriptionPos searches for a substring, Substr, in a string, S. Substr and S are string-type expressions.Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos is case-sensitive. If Substr is not found, Pos returns zero.