Returns the index of the first occurrence of a value within a list. Returns 0 if no value was found. The search is case-insensitive.
ListFindNoCase(list, value [, delimiters ])
Parameter |
Description |
---|---|
list |
List to search |
value |
Number or string sought among elements of list |
delimiters |
Set of delimiters used in list |
Note ColdFusion ignores empty list elements; thus, a list that is defined as "a,b,c,,,d" is treated as a four element list. |
<!--- This example uses ListFind and ListFindNoCase to determine whether substring exists in a list ---> ... <cfset temp = ListFindNoCase(myList, FORM.myString)> <cfif temp is 0> <H3>An employee with that exact last name was not found</H3> <cfelse> <cfoutput> <P>Employee #ListGetAt(ValueList(SearchEmpLastName.FirstName), temp)# #ListGetAt(ValueList(SearchEmpLastName.LastName), temp)#, of the #ListGetAt(ValueList(SearchEmpLastName.Department), temp)# Department, can be reached at #ListGetAt(ValueList(SearchEmpLastName.Phone), temp)#. <P>This was the first employee found under this case-insensitive last name search. </cfoutput> </cfif> </cfif> </cfif> </body> </html>