Spec-Zone.ru › ColdFusion

replaceListNoCase

Replaces occurrences of the elements from a delimited list in a string with corresponding elements from another delimited list. The search is case-insensitive.

replaceListNoCase(string, list1, list2, includeEmptyFields) replaceListNoCase(string, list1, list2, delimiter, includeEmptyFields) replaceListNoCase(string, list1, list2, delimiterList1, delimiterList2, includeEmptyFields) → returns string

  • CF2016+
  • Lucee5.1.0+
  • BL 1.0.0+
  • See Also: replaceList

    Argument Reference

    string string
    Required

    A string, or a variable that contains one, within which to replace substring

    list1 string
    Required

    List of substrings for which to search

    list2 string
    Required

    List of replacement substrings

    delimiter string
    Default: ,

    Common delimiter for both search and replacement.

    delimiterList1 string
    Default: ,

    Delimiter for search.

    delimiterList2 string
    Default: ,

    Delimiter for replacement.

    includeEmptyFields boolean
    Default: false

    When true, zero-length list elements are preserved.

    Examples
    Sample code invoking the replaceListNoCase function

    Tag Example

    <cfset myString = "My test string" />
    <cfset mySubstring1 = "Test, String" />
    <cfset mySubString2 = "Replaced, Sentence" />
    <cfoutput>#replaceListNoCase(myString, mySubstring1, mySubString2)#</cfoutput>

    Expected Result: My Replaced Sentence

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

    Spec-Zone.ru

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