listFindNoCase

Determines the index of the first list element in which a specified value occurs. Returns 0 if not found. Case-insensitive.

listFindNoCase(list, value [, delimiters, includeEmptyValues]) → returns numeric

Member Function Syntax

list.listFindNoCase(value [, delimiters, includeEmptyValues])

Argument Reference

list string
Required

List to search in.

value string
Required

String to search for.

delimiters string
Default: ,

String of character(s) that separate list elements.

includeEmptyFields string
Default: false

If includeEmptyFields is set to true, empty list elements will be counted when index of the first found list element is returned.
Values:
  • true
  • false

Examples
Sample code invoking the listFindNoCase function

Find item in a list and return the index.

listFindNoCase("apple,orange,banana", "orange")

Expected Result: 2

Find item in a pipe delimited list and return the index.

listFindNoCase("apple|orange|banana", "orange", "|")

Expected Result: 2

listFindNoCase as a member function

fruits = "apple|orange|banana";
writeOutput(fruits.listFindNoCase("ORANGE", "|"));

Expected Result: 2

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub