endsWith() | Zoho QEngine Help

endsWith()

In a nutshell
The endsWith() function performs a case-sensitive search to see if a string ends with a specified search string. It takes a string and the search string as arguments and returns True if the string ends with the search string and False otherwise. It is useful in test scripts where you need to validate that a text value ends with a specific suffix.

Overview

The endsWith() function takes a string and a searchString as arguments. It returns True if searchString is found at the end of the string. Otherwise, it returns False.

Note: This function performs a case-sensitive search.

Return Type

  • Boolean

Syntax

  1. <variable> = <string>.endsWith( <searchString> );

(OR)

  1. <variable> = endsWith( <string>, <searchString> );
ParameterDescriptionData type
<variable>Variable which will contain the boolean value, true or false.BOOLEAN
<string>

The string which may end with the searchString.

TEXT
<searchString>

The searchString with which the main string may end.

TEXT

Examples

  1. Product="Zoho QEngine";
  2. var = endsWith(Product, "Creator");     //returns true
  3. Product="Zoho QEngine";
  4. var = endsWith(Product, "creator");     //returns false