MACROMEDIA COLFUSION MX 7-CFML Reference page 713

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

ListContains
Description
Determines the index of the first list element that contains a specified substring.
Returns
Index of the first list element that contains substring. If not found, returns zero.
Category
List functions
Function syntax
ListContains(list, substring [, delimiters ])
See also
ListContainsNoCase
ColdFusion MX Developer's Guide
Parameters
Parameter
list
substring
delimiters
Usage
ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.
Example
<!--- This example shows differences between ListContains and ListFind --->
<!--- Create a list composed of the elements one, two, three. ---->
<cfset aList = "one">
<cfset aList = ListAppend(aList, "two")>
<cfset aList = ListAppend(aList, "three")>
<p>Here is a list: <cfoutput>#aList#</cfoutput>
<p><strong>ListContains</strong> checks for substring "wo" in the list
elements:
<cfoutput>
<p>&nbsp;&nbsp;&nbsp;Substring "wo" is in
<B>element #ListContains(aList, "wo")#</B> of list.
</cfoutput>
<p>ListFind cannot check for a substring within an element; therefore, in the
code, it does not find substring "wo" (it returns 0):
<cfoutput>
<p>&nbsp;&nbsp;&nbsp;Substring "wo" is in <b>element #ListFind(aList, "wo")#
</b> of the list.</cfoutput>
<p><p>If you specify a string that exactly equals an entire list element, such
,
; "Lists" in Chapter 3, "Using ColdFusion Variables," in
ListFind
Description
A list or a variable that contains one.
A string or a variable that contains one. The search is case-sensitive.
A string or a variable that contains one. Character(s) that separate list elements.
The default value is comma.
If this parameter contains more than one character, ColdFusion processes each
occurrence of each character as a delimiter.
ListContains
713

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents