Determines whether that index exists in the given list or not
listIndexExists(list, index [, delimiter] [, includeEmptyFields])
returns boolean
list.listIndexExists(index [, delimiter] [, includeEmptyFields])
Name | Type | Required | Default | Description |
---|---|---|---|---|
list | string | Yes | ||
index | numeric | Yes | ||
delimiter | string | No | , | |
includeEmptyFields | boolean | No |
Check whether the index is exists or not in list
<cfset list="Apple,Orange,Banana,Graphs">
<cfif listIndexExists(list,2)>
<cfset list=listsetAt(list,2,"Goa")>
</cfif>
<cfoutput>#list#</cfoutput>