Description

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

Returns

Index of the first list element that contains substring, regardless of case. If not found, returns zero.

History

ColdFusion (2018 Release): Introduced named parameters.

Category

List functions

Function syntax

ListContainsNoCase(list, substring [, delimiters, includeEmptyFields ])

See also

ListContainsListFindNoCaseLists in Data types- Developing guide in the Developing ColdFusion Applications

Parameters

Parameter

Description

includeEmptyFields

Optional. Set to yes to include empty values.

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. Characters 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.

Usage

ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.

Example

<cfscript>
       myList="Tokyo,Bangkok,bangkok,bangKok,Jakarta,Manila,Bangalore,Shanghai";
       WriteOutput(ListContainsNoCase(myList,"bangkok")); //Returns 2 as the first instance of Bangkok irrespective of case
</cfscript>

Output

2

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy