listChangeDelims

Description

Changes a list delimiter.

Categories

Related

Syntax

ListChangeDelims(list, new_delimiter [, delimiters, includeEmptyValues ])

Attributes

AttributeDescriptionRequiredDefault
delimitersA 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.
includeEmptyValuesOptional. Set to yes to include empty values.
listA list or a variable that contains one.
new_delimiterDelimiter string or a variable that contains one. Can be an empty string. ColdFusion processes the string as one delimiter.

Returns

A copy of the list, with each delimiter character replaced by new_delimiter.

Example

<h3>ListChangeDelims Example</h3> 
ListChangeDelims lets you change the delimiters of a list. 
<!--- First, query to get some values for our list elements---> 
<CFQUERY NAME="GetParkInfo" DATASOURCE="cfdocexamples"> 
    SELECT PARKNAME,CITY,STATE 
    FROM Parks 
    WHERE PARKNAME LIKE 'BA%' 
</CFQUERY> 
<CFSET temp = ValueList(GetParkInfo.ParkName)> 
<cfoutput> 
The original list: #temp# 
</cfoutput> 
<!--- Change the delimiters in the list ---> 
<CFSET temp2 = ListChangeDelims(Temp, "|:P|", ",")> 
<cfoutput> 
After executing the statement  
    <strong>ListChangeDelims(Temp, "|:P|", ",")</strong>,  
    the updated list: #temp2# 
</cfoutput>