Pos Function

Applies to TestComplete 15.31, last modified on March 17, 2022

The Pos function searches for a substring within a string.

Declaration

Pos(SubStrStr) Parameters
SubStr [in] Required String
Str [in] Required String
Result     Integer  

Description

Returns the position of the first match for the SubStr substring within the Str string. The search is case-sensitive.

Parameters

The function has the following parameters:

SubStr

Specifies the substring to be found.

Str

Specifies the source string.

Return Value

If the substring was found in the string, the function returns a 1-based index of the first matching character. If the substring was not found, the function returns 0.

Remarks

For a case-insensitive string search, use the aqString.Find method.

See Also

DelphiScript - List of Supported Routines and Variables
Copy
Delete
Insert
Length
Find Method

Highlight search results