getPrefix()
Table of Contents
Overview
The getPrefix() function takes string and searchString as arguments. It returns all the characters which precede the first occurrence of searchString in the string.
If the searchString is not found, this function returns null.
Note: This function performs a case-sensitive search.
Return Type
- TEXT
Syntax
<variable> = <string>.getPrefix( <searchString> );
(OR)
<variable> = getPrefix( <string>, <searchString>);
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned characters. | TEXT |
<string> | The string from which all the characters preceding the searchString will be returned. | TEXT |
<searchString> |
| TEXT |
Examples
text = "Zoho Creator is an online database service, which helps you create custom applications" ;
newText = text.getPrefix(",");
//returns "Zoho Creator is an online database service"
newText = text.getPrefix(",");
//returns "Zoho Creator is an online database service"