Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

coldfusion: listContains and listFind

Whats the difference between listContains() and listFind() / listFindNoCase()?

They are all list functions, take the same parameters, and return the same result.

like image 886
Rumpleteaser Avatar asked Sep 13 '12 01:09

Rumpleteaser


1 Answers

listContains looks for the value anywhere in a string, so for example

<cfset list = '1,2,33,4,5' />
<cfdump var="#listContains(list,3)#"> 

Would return 3 because a 3 is found in the 3rd list item.

listFind looks for the value AS one of the list items.

<cfdump var="#listFind(list,3)#"> 

Returns 0 because 3 is not one of the list items.

like image 157
Matt Busche Avatar answered Sep 21 '22 13:09

Matt Busche