Applies to TestComplete 14.30, last modified on November 21, 2019
This method is obsolete. See the Remarks section below.

Description

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.

Declaration

aqString.Contains(InputStringSubStringStartPositionCaseSensitive)

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:

Parameters

The method has the following parameters:

InputString

Specifies the string where a substring will be sought for.

SubString

Specifies the sought-for string.

StartPosition

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

CaseSensitive

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.

Remarks

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

aqString.Find Method

Highlight search results