Determines whether that index exists in the given list or not

listIndexExists(list, index [, delimiter] [, includeEmptyFields]) → returns boolean

Member Function Syntax

list.listIndexExists(index [, delimiter] [, includeEmptyFields])

This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

listIndexExists Argument Reference

list string

index numeric

delimiter string
Default: ,

includeEmptyFields boolean

Examples sample code invoking the listIndexExists function

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")>

Expected Result: Apple,Goa,Banana,Graphs

Fork me on GitHub