• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Name

ListFindNoCase

Synopsis

                  ListFindNoCase(list, value [, delimiters])

Returns the index of the first occurrence of value in the specified list. The search is case-insensitive. If no matches are found, 0 is returned. An optional delimiter can be specified if the list is delimited with a character other than the comma (the default). Here’s an example that returns the index of the first element in a list that matches saturday:

<cfset MyList = "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday">
<cfset TheValue = "saturday">
<cfset TheIndex = ListFindNoCase(MyList, TheValue)>
   
<cfoutput>
<b>List:</b> #MyList#
<p><cfif TheIndex is 0>
  The value (#TheValue#) could not be found in the list!
<cfelse>
  The Value (#TheValue#) was found in element #TheIndex# 
  (#ListGetAt(MyList, TheIndex)#).
</cfif>
</cfoutput>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint