trim() | Zoho QEngine Help

trim()

In a nutshell
The trim() function takes a string as an argument and returns the same string after removing all leading and trailing spaces. The return type is Text. It is useful in test scripts where you need to clean up text values before using them in comparisons or assertions.

Overview

The trim() function takes a string as an argument. It returns the string after removing all leading and trailing spaces from it.

Return Type

  • Text

Syntax

  1. <variable> = <string>.trim();

(OR)

  1. <variable> = trim( <string> );


ParameterDescriptionData type
<variable>Variable which will contain the returned string.TEXT
<string>The string from which the leading and trailing spaces will be removed.TEXT

Examples

  1. mainString = " Welcome to Zoho QEngine ";
  2. newText = trim(mainString);           
  3. // returns "Welcome to Zoho QEngine"