left()
Table of Contents
Overview
The left() function takes a string and a number as arguments. It returns the specified number of characters from the string's left side.
Return Type
- Text
Syntax
<variable> = <string>.left(<number>);
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned string value. | TEXT |
<string> | The string from which the characters will be returned. | TEXT |
<number> | The number of characters which will be returned. If the number exceeds the count of characters in the string, an error will be encountered during runtime. Negative values will return the full string. | NUMBER |
Examples
product_name="Zoho Creator";
newText = product_name.left(4); // returns "Zoho"
newText = product_name.left(4); // returns "Zoho"