listContains

Determines the index of the first list element that contains a
specified substring.
Returns the index of the first list element that contains
substring. If not found, returns zero. The search for the substring is case-sensitive.

listContains(list, substring [, delimiters]) → returns numeric

Argument Reference

list string
Required

substring string
Required

delimiters string
Default: ,

Examples
Sample code invoking the listContains function

Return the first instance of an item containing 'oo'

listContains("sheep,goat,foo,bar,goo", "oo")

Expected Result: 3

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

Fork me on GitHub