replaceNoCase

Replaces occurrences of substring1 with substring2, in the
specified scope. The search is case-insensitive.

replaceNoCase(String, substring1, substring2 [, scope]) → returns String

Argument Reference for the replaceNoCase function

String

Required: Yes
A string (or variable that contains one) within which to
replace substring

substring1

Required: Yes

substring2

Required: Yes

scope

Required: No
* one: Replace the first occurrence (default)
* all: Replace all occurrences Values:
  • one
  • all

Examples sample code invoking the replaceNoCase function


Script Syntax

getVal = replaceNoCase("ColdFUsion", "u", "a"); 
 writeDump(getVal);

Expected Result: Expected Result: ColdFasion


Tag Syntax

<cfset getVal = replaceNoCase("ColdFusiOn", "O", "a", "ALL")> 
 <cfdump var="#getVal#">

Expected Result: Expected Result: CaldFusian


Fork me on GitHub