length() | Zoho QEngine Help

length()

In a nutshell
The length() function takes a string as an argument and returns the total count of characters in that string, including spaces. The return type is Number. It is useful in test scripts where you need to validate or compare the character length of a text value.

Overview

The length() function takes a string as an argument. It returns the count of characters (including spaces) in that string.

Return Type

  • Number

Syntax

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

(OR)

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

(OR)

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

(OR)

  1. <variable> = len(<string>);
ParameterDescriptionData type
<variable>Variable which will contain the count of characters.NUMBER
<string>The string whose number of characters will be returned.TEXT

Examples

  1. text = "Create database applications with Zoho Creator";
  2. textLength= text.length();         //returns 46