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;

解决方案 »

  1.   

    给你几个函数,自己试一下吧
    function RightStr (const S : string; const N : Integer): string;
    var
    M: Integer;
    begin
    M := Length (S) - N + 1;
    if M < 1 then
    M := 1;
    Result := Copy (S, M, N);
    end;function LeftTillStr (const S : string; const Ch : Char): string;
    var
    M: Integer;
    begin
    M := Pos (Ch, S);
    if M < 2 then
    Result := ''
    else
    Result := Copy (S, 1, M - 1);
    end;function RightAfterStr (const S : String; const N : Integer): String;
    begin
    Result := Copy (S, N + 1, Length (S) - N );
    end;