刚才给您写了一个函数,调试成功了。别忘记给我加分哦。function strC(str1,str2:String):boolean;
//str1是你的abc,str2是你的abcdefg
var i,len1:integer;
begin
  if length(str1) > length(str2) then begin
   strC := false;
   exit;
  end;
 len1:=length(str1);
 for I := 1 to length(str2) do begin
   if str1= Copy(Str2, i, len1) then begin
     strC := true;
     exit
    end
   else
    strC := false;
 end;
end;

解决方案 »

  1.   

    n:=pos('abc', s );
    if ( n >= 0 ) Then
       //  s 中有abc
    else
       //  没有
      

  2.   

    使用POS函数,判断Pos()是否>0比较简明。function Pos(Substr: string; S: string): Integer;Pos 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 ignores case-insensitive matches. If Substr is not found, Pos returns zero.
      

  3.   

    这样:  function InString(qSubstr, FatherStr: string):Boolean;
      begin
        if Pos(qSubstr, Fatherstr) = 0 then Result := False
        else Result := True;
      end;
      

  4.   

    OH MY GOD!!!我忘记有个函数叫 pos  了!!!!气死我了!!!!!!!!!!!