August 2001
Intermediate to advanced
976 pages
38h 8m
English
ListContainsNoCase
ListContainsNoCase(list, substring[,delimiters])
Returns the index of the first element in the list that contains the
specified substring as part of the element. If the substring
isn’t found, 0 is returned. The search is case-insensitive. An
optional delimiter can be specified if the list is delimited with a
character other than the comma (the default). The following example
returns the index of the first element in a list that contains
wed:
<CFSET MyList = "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday"> <CFSET TheSubstring = "wed"> <CFSET TheIndex = ListContainsNoCase(MyList, TheSubstring)> <CFOUTPUT> <B>List:</B> #MyList# <P><CFIF TheIndex IS 0> The substring (#TheSubstring#) could not be found in the list! <CFELSE> The substring (#TheSubstring#) was found in element #TheIndex# (#ListGetAt(MyList, TheIndex)#). </CFIF> </CFOUTPUT>
Read now
Unlock full access