Contents > CFML Reference > ColdFusion Functions > ReplaceNoCase PreviousNext

ReplaceNoCase

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

A copy of the string, after making replacements.

String functions

ReplaceNoCase(string, substring1, substring2 [, scope ])

Find, REFind, Replace, ReplaceList, REReplace

Parameter

Description

string

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

substring1

String (or variable that contains one) to replace, if found.

substring2

String (or variable that contains one) that replaces substring1

scope

  • one: Replace the first occurrence (default)
  • all: Replace all occurrences

<h3>ReplaceNoCase Example</h3>
<p>The ReplaceNoCase function returns <I>string</I> with <I>substring1</I>
replaced by <I>substring2</I> in the specified scope.
The search/replace is case-insensitive. <cfif IsDefined("FORM.MyString")> <p>Your original string, <cfoutput>#FORM.MyString#</cfoutput> <p>You wanted to replace the substring <cfoutput>#FORM.MySubstring1# </cfoutput> with the substring <cfoutput>#FORM.MySubstring2#</cfoutput>. <p>The result: <cfoutput>#ReplaceNoCase(FORM.myString, FORM.MySubstring1, FORM.mySubString2)#</cfoutput> </cfif>

Contents > CFML Reference > ColdFusion Functions > ReplaceNoCase PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa70.htm