removeFirstOccurence()
Table of Contents
Overview
The removeFirstOccurence() function takes string and searchString as arguments. It returns the string after removing the first occurrence of searchString from it.
If the searchString is not present in the string, it will return the string as it is.
Note: This function performs a case-sensitive search.
Return Type
- Text
Syntax
<variable> = <string>.removeFirstOccurence(<searchString>);
(OR)
<variable> = removeFirstOccurence(<string>, <searchString>);
Parameter | Description | Data type |
---|---|---|
<variable> | Variable which will contain the returned string. | TEXT |
<string> | The string from which the first occurrence of the searchString will be removed | TEXT |
<searchString> |
| TEXT |
Examples
Product="Zoho Creator 5";
newText = Product.removeFirstOccurence("5");
// returns "Zoho Creator "
newText = Product.removeFirstOccurence("5");
// returns "Zoho Creator "