ReplaceAllIgnoreCase()
Table of Contents
Overview
The replaceAllIgnoreCase() function searches all the occurrences of searchText in the inputText and replaces them with the replacementText. If the searchText is not found, this function returns the inputText as it is.
Note:
- This task performs a case-insensitive search. In order to perform a case-sensitive search, use the replaceAll built-in function.
- The size of each input and output parameter of this function can individually be up to 300 KB.
Return Type
- TEXT
Syntax
<variable> = <inputText>.replaceAllIgnoreCase(<searchText>, <replacementText>, <boolean>);
(OR)
<variable> = replaceAllIgnoreCase(<inputText>, <searchText>, <replacementText>, <boolean>);
Parameter | Data type | Description |
---|---|---|
<variable> | TEXT | Variable which will contain the returned text. |
<inputText> | TEXT | The text in which all occurrences of searchText will be replaced with replacementText. |
<searchText> | TEXT |
|
<replacementText> | TEXT | This replacementText will replace all occurrences of searchText in the inputText. |
<boolean> | TEXT | Applicable values: true or false. By default, the replaceAllIgnoreCase() function supports regular expression (i.e) it will not find and replace the special characters like $ in the input text. This parameter can be used to specify if the regular expression is to be supported or escaped.
|
Example
The following example searches for the text - ZOHO in the inputText and replaces all of its occurrences with Z.
inputText = "Zoho Creator, Zoho Desk, Zoho CRM"; newText = replaceAllIgnoreCase(inputText,"ZOHO ","Z"); // returns "ZCreator, ZDesk, ZCRM" info newText;