Copy Function

Applies to TestComplete 15.47, last modified on January 20, 2023

The Copy function returns a substring of the specified string.

Declaration

Copy(StrIndexCount) Parameters
Str [in] Required String
Index [in] Required Integer
Count [in] Required Integer
Result     String  

Description

Returns a substring of Str starting from the position specified in the Index parameter. The length of the substring is specified in the Count parameter. If Index is larger than the length of the string, Copy returns an empty string.

Parameters

The function has the following parameters:

Str

Specifies the source string.

Index

Specifies the number of the character from which retrieval of the substring starts.

Count

Specifies the length of the retrieved substring. If Count specifies more characters than the Str string contains, the function returns only those characters that start from the Index position and go to the end of the string.

Return Value

A string that contains the retrieved substring.

See Also

DelphiScript - List of Supported Routines and Variables
Delete
Insert
Length
Pos

Highlight search results