Length Function

Applies to TestComplete 15.69, last modified on November 13, 2024

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