Contact Form

Name

Email *

Message *

Cari Blog Ini

Cfml Replacenocase

ReplaceNoCase Function

Summary

Replaces occurrences of substring1 with substring2 in the specified scope.

Syntax

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

Parameters

source
The string in which to search and replace.
substring1
The substring to search for.
substring2
The substring to replace substring1 with.
scope
The scope in which to replace. The default value is "all".

Return Value

Returns the modified string with the replacements made.

Usage Notes

The ReplaceNoCase function performs a case-insensitive search and replace operation on the specified string.

The scope parameter can be used to specify the scope of the replacement. The default value is "all", which means that all occurrences of substring1 will be replaced. Other possible values for scope are:

  • "first" - Replace only the first occurrence of substring1.
  • "last" - Replace only the last occurrence of substring1.
  • A number - Replace the specified number of occurrences of substring1.

Examples

<cfset myString = "This is a test string"> <cfset replacedString = ReplaceNoCase(myString, "test", "example")> <cfoutput>#replacedString#</cfoutput> 

Output

This is an example string.


Comments