getPrefix

This topic describes the syntax and usage of the getPrefix function in Zoho Creator .

Description

The getPrefix function returns the first argument string from it's start, up to first occurrence of the second argument string. Returns the prefix. 

Syntax

getPrefix(string , substring)

(or)

string.getPrefix(substring)

The getPrefix function syntax has the following arguments.
string - Required. The main string from which you what to getthe prefix.
substring - Required. The string to be searched for within the main string.
If no substring is found, a null is returned.

Example

Name = "Create online database applications with Zoho Creator";

Name.getPrefix("with") //returns "Create online database applications "

Name = "Create online database applications with Zoho Creator";

getPrefix(Name,"with") //returns "Create online database applications "