如:string;  要取出s
   csdnttr  要取出csdn
   qurite   要取出quri
请问要用哪个或哪几个函数来达到这个功能?
不好意思,刚学,又没有书查`~请赐教`~

解决方案 »

  1.   

    str:=copy('string',1,1);
    str:=copy('csdnttr',1,4);
    str:=copy('qurite',1,4);
      

  2.   

    如上.很正确,块给nightCloud分吧,人家很幸苦 .别说到不做到
      

  3.   

    谢谢 qi_gu(苦瓜)的支持,hehe
      

  4.   

    function LeftStr(const AText: string; ACount: Integer): string;
    str:=LeftStr('string',1);相应RightStr,MidStr.
      

  5.   


    function GetStrBeforT(sString:string):string
    VAR 
        I:Integer;
    begin
    Result
        FOR I:=0 tp Length(sString) do
        begin
            if sString[i]<>'t' then 
                Result:=Result+sString[i];
        end;
    end;
      

  6.   

    function GetStrBeforT(sString:string):string;
    VAR
        I:Integer;
    begin
        Result:='';
        FOR I:=0 to Length(sString) do
        begin
            if sString[i+1]<>'t' then
                Result:=Result+sString[i+1]
            else
                exit;
        end;
    end;
      

  7.   

    哈哈,搞了这么久我才搞出来`~原来应该是这样写的:
    LeftStr(string1,(AnsiPos('t',string1)-1))好了,虽然你们说得都不是完美,但我还是看答案给分吧