TStrings.IndexOf

Applies to TestComplete 14.60, last modified on April 22, 2021

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