Spec-Zone.ru › ColdFusion

replaceNoCase

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

replaceNoCase(string, substring1, callback [, scope]) → returns string

Member Function Syntax

string.replaceNoCase(substring1, callback[, scope])

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: replace replaceList reReplace reReplaceNoCase

    Argument Reference

    string string
    Required

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

    substring1 string
    Required

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

    callback any
    Required

    String to replace substring1 with. As of CF 2018+ you can also pass a callback function in this argument function(transform, position, original).

    scope string

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

    start numeric
    Default: 1

    CF 2021+ Position to start searching in the string.

    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

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/replacenocase

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API