Lucee Function Reference

replacelist()

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

Example

replacelist(string string,string list1,string list2,[string delimiter_list1,[string delimiter_list2,[boolean includeEmptyFields]]]):string

Category

string,list

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
string string  Yes A string  
list1 string  Yes string list of search strings  
list2 string  Yes string list of replacement strings  
delimiter_list1 string  No Delimiter for search, or if no replacement delimiter is defined, this delimiter is used for search and replacement.  
delimiter_list2 string  No Delimiter for replacement.  
includeEmptyFields boolean  No When true, empty elements are preserved