Rajesh Manilal
Rajesh Manilal

Reputation: 1124

Check string contains a list element using Coldfusion

I know that listcontains() is used to check the list contains a specified string. And is there any way to check a string contains a list element using Coldfusion?

Upvotes: 1

Views: 2656

Answers (2)

Dan Bracuk
Dan Bracuk

Reputation: 20804

Like this:

<cfloop from="1" to="#ListLen(yourList)#" index="elemementNumber">
<cfif yourString contains ListGetAt(elemementNumber)>
yes
<cfelse>
no
</cfif>
</cfloop>

Upvotes: 2

Richard Herbert
Richard Herbert

Reputation: 626

I think what you need is ListFindNoCase() or ListFind() depending on the obvious.

Upvotes: 0

Related Questions