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