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.

4

1 Answer

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like