| Contents > CFML Reference > ColdFusion Functions > ListContainsNoCase |
|
|
|
|
||
Determines the index of the first list element that contains a specified substring.
Index of the first list element that contains substring, regardless of case. If not found, returns zero.
ListContainsNoCase(list, substring [, delimiters ])
Parameter |
Description |
|---|---|
list |
A list or a variable that contains one. |
substring |
A string or a variable that contains one. The search is case-insensitive. |
delimiters |
A string or a variable that contains one. Character(s) that separate list elements. Default: comma. If this parameter contains more than one character, ColdFusion processes each occurrence of each character as a delimiter. |
ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.
<h3>ListContainsNoCase Example</h3>
<cfif IsDefined("form.letter")>
<!--- First, query to get some values for our list --->
<cfquery name="GetParkInfo" datasource="cfsnippets">
SELECT PARKNAME,CITY,STATE
FROM Parks
WHERE PARKNAME LIKE '#form.letter#%'
</cfquery>
<cfset tempList = #ValueList(GetParkInfo.City)#>
<cfif ListContainsNoCase(tempList, form.yourCity) is not 0<p>
There are parks in your city!
<cfelse>
<p>Sorry, there were no parks found for your city.
Try searching under a different letter.
</cfif>
</cfif>
|
|
||
| Contents > CFML Reference > ColdFusion Functions > ListContainsNoCase |
|
|
ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functib7.htm
Comments
profit11 said on Jun 30, 2004 at 10:02 AM :