next up previous contents index
Next: Cos Up: Functions and Procedures Previous: Concat

Copy

   

Declaration:

Function Copy (Const S : String;Index : Integer;Count : Byte) : String;

Description:

Copy returns a string which is a copy if the Count characters in S, starting at position Index. If Count is larger than the length of the string S, the result is truncated.

If Index is larger than the length of the string S, then an empty string is returned.

Errors:

None.

See also:

Delete, Insert, Pos

Example
Program Example11;

{ Program to demonstrate the Copy function. }

Var S,T : String;

begin
  T:='1234567';
  S:=Copy (T,1,2);   { S:='12'   }
  S:=Copy (T,4,2);   { S:='45'   }
  S:=Copy (T,4,8);   { S:='4567' }
end.



root
Fri Sep 11 18:27:51 CEST 1998