FUNCTION:ARRAYCONTAINS

last edited byusericontbankert on 15-Sep-2011

Contents

ArrayContains

Description

Determines the index of the first array element that contains a specified substring.

Category

Array functions

Implemented

Usage Syntax

ArrayContains(array,substring)

Return Information

Return Type Return Description
number Index of the first array element that contains substring. If not found, returns zero.

Arguments

Name Type Required Position Default Description
array array Yes 1 Name of an array.
substring string Yes 2 A string or a variable that contains one. The search is case-sensitive.

Example Usage

<cfset fruit = Array("apples","peaches","oranges","bananas")>  
<cfif ArrayContains(fruit,"peaches") NEQ 0>
	<cfoutput>#fruit[ArrayContains(fruit,"peaches")]#</cfoutput>
</cfif>

 
Download in other Formats:
markup Markup | pdf PDF | html HTML | word Word