FUNCTION:ARRAYCONTAINSNOCASE

last edited byusericontbankert on 15-Sep-2011

Contents

ArrayContainsNoCase

Description

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

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, regardless of case. 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 not case-sensitive.

Example Usage

<cfset fruit = Array("apples","PeachEs","oranges","bananas")>  
<cfif ArrayContainsNoCase(fruit,"PEACHES") NEQ 0>
	<cfoutput>#fruit[ArrayContainsNoCase(fruit,"PeACHes")]#</cfoutput>
</cfif>

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