Creator Help

removeFirstOccurence

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

Description

The removeFirstOccurence function removes the first occurence of the substring from the given string. Returns the remaining string.

Syntax

<string>.removeFirstOccurence(substring)

(or)

removeFirstOccurence(<string>,<substring>) //this format is supported only in the free flow scripting mode of Script builder.

The removeFirstOccurence function syntax has the following arguments.

string - Required. The main string from which you what to remove str2.

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

Example

Name = "ZohoCreator";

Name.removeFirstOccurence("o") //returns "ZhoCreator"

Name = "ZohoCreator";

removeFirstOccurence(Name,"o") //returns "ZhoCreator"



Top