Whatever message this page gives is out now! Go check it out!
ReplaceList(string, list1, list2,includeEmptyFields)
ReplaceList(string, list1, list2, delimiter, includeEmptyFields)
ReplaceList(string, list1, list2, delimiter_list1, delimiter_list2, includeEmptyFields)Parameter | Description |
string | A string, or a variable that contains one, within which to replace substring |
list1 | Comma-delimited list of substrings for which to search |
list2 | Comma-delimited list of replacement substrings |
delimiter | Common delimiter for both search and replacement. |
delimiter_list1 | Delimiter for search. |
delimiter_list2 | Delimiter for replacement. |
includeEmptyFields | When true, empty list elements are preserved. |
<cfscript>
stringtoreplace = "The quick brown fox jumped over the lazy dog."
writeOutput(ReplaceList(stringtoreplace,"dog:brown:fox:black", "cow:black:ferret:white", ":"))
</cfscript><cfscript>
stringtoreplace = "The quick brown fox jumped over the lazy dog."
writeOutput(ReplaceList(stringtoreplace,"dog:brown:fox:black", "cow-black-ferret-white", ":" ,
"-"))
</cfscript><cfscript>
stringtoreplace = "The quick brown fox jumped over the lazy dog."
writeOutput(ReplaceList(stringtoreplace, "dog:brown:fox:black", "--black-ferret-white", ":", "-", true))
</cfscript><cfscript>
stringtoreplace = "The quick brown fox jumped over the lazy dog."
writeOutput(ReplaceList(stringtoreplace, "dog:brown:fox:black", "--black-ferret-white", ":", "-", false))
</cfscript>