Choose where you’d like to start

ReplaceAllIgnoreCase()

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>);
ParameterData typeDescription
<variable>TEXTVariable which will contain the returned text.
<inputText>TEXTThe text in which all occurrences of searchText will be replaced with replacementText.
<searchText>TEXT


All occurrences of this searchText will be replaced with replacementText in the inputText.

<replacementText>TEXTThis 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.

  • The value true denotes escaping the regular expression.
  • The value false denotes supporting the regular expression. By default, the value is taken as "false".

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;

Related Links

Get Started Now

Execute