TStrings.IndexOf

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

Returns the position of the specified string in the list.

Declaration

TStringsObj.IndexOf(S) Parameters
TStringsObj     A TStrings object  
S [in] Required String
Result     Integer  

Description

Use the IndexOf method to determine the position of the first occurrence for string S in the list. This method searches for string S as well as for any string that differs from S only by case.

Parameters

The method has the following parameter:

S

The string to be searched for.

Return Value

A zero-based integer number that signifies the position of the added string in the list. If the specified string was not found, IndexOf returns -1.

See Also

TStrings.Count

Highlight search results