copy

Declaration: copy(s: string; index, count: integer): string;
Results in a string which is a copy of the count characters in s, starting at the position index. If the parameter 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. Index is 1-based.

Example: Assuming that the variable s2 contains the string 'The earth has only one moon' the statement s1 := copy(s2,5,8); returns 'earth ha' to the variable s1.