BuiltIn.StrEndsWith Method

Applies to TestComplete 15.69, last modified on November 13, 2024
This method is obsolete. See the Remarks section below.

Description

Use this function to find out whether a substring is contained in the end of another string.

Declaration

BuiltIn.StrEndsWith(SubStr, Str, CaseSensitive)

SubStr [in]    Required    String    
Str [in]    Required    String    
CaseSensitive [in]    Optional    Boolean Default value: True   
Result Boolean

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

SubStr

Specifies a sought for substring.

Str

Specifies a string to be tested for occurrences of SubStr at the end.

CaseSensitive

An optional Boolean value that defines whether the search should be performed regarding or ignoring letter-case. By default, the search is case-sensitive.

Result Value

True if the specified substring was found at the end of a string and False otherwise.

Remarks

This method is obsolete. It is supported for backward compatibility only. To compare strings, use the methods of the aqString object.

Example

The following line of code searches for occurrence of "ABRA" at the end of a string "abracadabra". Since the search is case insensitive, the result is True.

JavaScript, JScript

Log.Message( BuiltIn.StrEndsWith("ABRA", "abracadabra", false) );

Python

Log.Message(BuiltIn.StrEndsWith("ABRA", "abracadabra", False))

VBScript

Log.Message( BuiltIn.StrEndsWith("ABRA", "abracadabra", False) )

DelphiScript

Log.Message( BuiltIn.StrEndsWith('ABRA', 'abracadabra', false) );

C++Script, C#Script

Log["Message"]( BuiltIn["StrEndsWith"]("ABRA", "abracadabra", false) );

See Also

StrStartsWith Method
Find Method
StrMatches Method

Highlight search results