Length Function

Applies to TestComplete 15.40, last modified on March 25, 2022

The Length function returns the number of characters of a string.

Declaration

Length(Str) Parameters
Str [in] Required String
Result     Integer  

Description

Returns the number of characters of the Str string.

Parameters

The function has the following parameter:

Str

Specifies the string to be processed.

Return Value

An integer value that holds the number of characters a string contains.

Example

The example below demonstrates how you can obtain the string length:

DelphiScript

procedure StringLength;
var aString;
begin
  aString:='Some text';
  Log.Message('The string is ' + IntToStr(Length(aString)) + ' character(s) long.');
end;

See Also

DelphiScript - List of Supported Routines and Variables
Copy
Delete
Insert
SetLength
Pos

Highlight search results