Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListContains, ListFind

Status
Not open for further replies.

laurent42

Programmer
Aug 7, 2001
13
US
I would like the following instruction "ListContains('2, 3, 11' , 1)" to return "0" since the list "2, 3, 11" does not contain "1" however it does not return "0" since "11" contains "1".

Is there another string comparaison ColdFusion function that I could use to do the same thing?

Thanks.
 
I think you want the ListFind() function. This should do what you need.

#ListFind("2, 3, 11" ,"1")#

Good luck,
GJ
 
I tried both ListFind and ListContains and the result is the same that is not "0"...

Any other suggestions?

Thanks.
 
I get 0 on the following code:

<cfoutput>
#ListFind(&quot;2, 3, 11&quot; , &quot;1&quot;)#
</cfoutput> - tleish
 
It seems that the data type may need to be set as a number rather than text?

Just a thought. DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top