给个例子看看,谢谢哦。

解决方案 »

  1.   

    还有一个copy(), 能不能通通告诉我。
      

  2.   

    看delphi自带的说明就可以
    --------------------------------例子如下-------------------------------------
    var S: string;begin
      S := '   123.5';
      { Convert spaces to zeros }
      while Pos(' ', S) > 0 do
        S[Pos(' ', S)] := '0';
    end;
    -------------------------------copy------------------------------------------
    Delphi syntax:function Copy(S; Index, Count: Integer): string;
    function Copy(S; Index, Count: Integer): array;DescriptionS is an expression of a string or dynamic-array type. Index and Count are integer-type expressions. Copy returns a substring or subarray containing Count characters or elements starting at S[Index]. The substring or subarray is a unique copy (that is, it does not share memory with S, although if the elements of the array are pointers or objects, these are not copied as well.)If Index is larger than the length of S, Copy returns an empty string or array.If Count specifies more characters or array elements than are available, only the characters or elements from S[Index] to the end of S are returned.Note: When S is a dynamic array, you can omit the Index and Count parameters and Copy copies the entire array.
      

  3.   

    Label1.Caption:=IntToStr(Pos('a','tabc'));
    //////////返回为a在串tabc中的位置,为2
        Label1.Caption:=Copy('tabc',1,3);
    /////拷贝,从第一个字符t拷贝3个,为tab
      

  4.   

    还用问?
    看Help就知道的http://lysoft.7u7.net
      

  5.   

    var
      i : integer;
      i:=Pos('a','dddda');
      showmessage(inttostr(i));