Creator Help

getOccurenceCount

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

Description

The getOccurenceCount function gets the number of times a substring is present in the given string.

Syntax

<string>.getOccurenceCount(<substring>)

(or)

getOccurenceCount(<string>, <substring>)

//this format is supported only in the free flow scripting mode of Script builder.

The getOccurenceCount function syntax has the following arguments.

string - Required. The main string from which you what to find the count of occurrences of the substring. 

substring - Required.  The string to be searched for within the main string.

Return Value

Returns the count of occurrences of the substring as a number. 

Example

text="Zoho Creator is an online database service to create custom database applications" ;

text.getOccurence>Count("database">);    //returns 2

text="Zoho Creator is an online database service to create custom database applications";

getOccurenceCount(text , "database");    //returns 2

Top