ListFind()

Determines the index of the first list element in which a specified value occurs. Case-sensitive

ListFind( list=string, value=string, delimiters=string, includeEmptyFields=boolean );

Returns: Number

Argument Description Default
list
string, required

a string list

value
string, required

element for which to search

delimiters
string, optional

Characters that separate list elements. The default value is comma.

Alias: delimiter

,

includeEmptyFields
boolean, optional

if set to true, empty values are included as well

false

Examples

writeOutput(listFind("I,love,lucee,testFile", "lucee"));//Expected output 3

//Member Function with @ delimiter strList="I@am@lucee@dev"; writeDump(strList.listFind("dev","@"));//Expected output 4

See also