用copy函数
copy(string,iBginIndex,iEndIndex)

解决方案 »

  1.   

    Delphi6中有。Delphi6扩展了很多常用函数。
      

  2.   

    //------------------------------------------------------------------------------function StrLeft(const S: AnsiString; Count: Integer): AnsiString;
    begin
      Result := Copy(S, 1, Count);
    end;//------------------------------------------------------------------------------function StrMid(const S: AnsiString; Start, Count: Integer): AnsiString;
    begin
      Result := Copy(S, Start, Count);
    end;//------------------------------------------------------------------------------function StrRight(const S: AnsiString; Count: Integer): AnsiString;
    begin
      Result := Copy(S, Length(S) - Count + 1, Count);
    end;
      

  3.   

    赫赫,楼上是老大写的;
    下面是Borland写的,位于StrUtils单元,都差不多!//------------------------------------------------------------------------------
    function LeftStr(const AText: string; const ACount: Integer): string;
    begin
      Result := Copy(AText, 1, ACount);
    end;
    //------------------------------------------------------------------------------
    function RightStr(const AText: string; const ACount: Integer): string;
    begin
      Result := Copy(AText, Length(AText) + 1 - ACount, ACount);
    end;
    //------------------------------------------------------------------------------
    function MidStr(const AText: string; const AStart, ACount: Integer): string;
    begin
      Result := Copy(AText, AStart, ACount);
    end;