Changes a list delimiter.
A copy of the list, with each delimiter character replaced by newDelimiter.
History
ColdFusion (2018 release): Made the following changes:
Function syntax
ListChangeDelims(list, newDelimiter [, delimiters, includeEmptyFields ])
ListFirst, ListQualify; Lists in the Developing ColdFusion Applications
Parameter |
Description |
|---|---|
includeEmptyFields |
Optional. Set to yes to include empty values. |
list |
A list or a variable that contains one. |
newDelimiter |
Delimiter string or a variable that contains one. Can be an empty string. ColdFusion processes the string as one delimiter. |
delimiters |
A string or a variable that contains one. Characters that separate list elements. The default value is comma . If this parameter contains more than one character, ColdFusion processes each occurrence of each character as a delimiter. |

<cfscript>
myList="a,b,c,d,e";
myChangeDelims=ListChangeDelims(myList,"|"); //Replace comma in the list with pipe
WriteOutput(myChangeDelims & " ");
myAnotherList="a,b|c|d,e|f";
myCustomDelims=ListChangeDelims(myAnotherList,"@","|"); //Replace occurrence of "|" with "@"
WriteOutput(myCustomDelims);
</cfscript>
Output
a|b|c|d|e a,b@c@d,e@f
Sign in to your account