aqString.Contains Method

Applies to TestComplete 15.65, last modified on June 26, 2024
This method is obsolete. See the Remarks section below.


Use the Contains method to locate an occurrence of a substring in the input string. If the input string holds several occurrences of a substring, the method returns the position of the first matching substring. To search for another occurrence, set a different starting point via the StartPosition parameter.


aqString.Contains(InputString, SubString, StartPosition, CaseSensitive)

InputString [in]    Required    String    
SubString [in]    Required    String    
StartPosition [in]    Optional    Integer Default value: 0   
CaseSensitive [in]    Optional    Boolean Default value: True   
Result Integer

Applies To

The method is applied to the following object:


The method has the following parameters:


Specifies the string where a substring will be sought for.


Specifies the sought-for string.


Specifies the initial position of the search. By default (StartPosition=0), the search starts from the beginning of the string.


Specifies whether the comparison should be case-sensitive or not.

Result Value

If the substring was found, the method returns the number of the first matching character, otherwise, it returns -1.


This method is obsolete and is not listed in the Code Completion window. It is supported for backward compatibility only. To search for a substring in a string, use the Find method.

See Also

Find Method

Highlight search results