LISTINSERTAT | |
Description
Inserts an element in a list. |
|
Returns
A copy of the list, with value inserted at the specified position. |
|
Category
List functions |
|
Function syntaxListInsertAt(list, position, value [, delimiters ]) |
|
See also
ListDeleteAt, ListAppend, ListPrepend, ListSetAt; "Lists" in Chapter 3, "Using ColdFusion Variables," in ColdFusion MX Developer's Guide |
|
Parameters
|
|
Usage
When inserting an element, ColdFusion inserts a delimiter. If delimiters contains more than one delimiter, ColdFusion uses the first delimiter in the string; if delimiters is omitted, ColdFusion uses a comma. ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements. |
|
Example<!--- This example shows ListInsertAt ---> <cfquery name = "GetParkInfo" datasource = "cfdocexamples"> SELECT PARKNAME,CITY,STATE FROM PARKS WHERE PARKNAME LIKE `DE%' </cfquery> <cfset temp = ValueList(GetParkInfo.ParkName)> <cfset insert_at_this_element = ListGetAt(temp, "3", ",")> <cfoutput> <p>The original list: #temp# </cfoutput> <cfset temp2 = ListInsertAt(Temp, "3", "my Inserted Value")> |
LIST | |
POSITION | |
VALUE | |
DELIMITERS | |