> Can someone confirm to me that this is the correct behaviour for
> listcontainsNoCase:

> <cfscript>
>    if( listContainsNoCase("MRS,MS,MISS", "mr"  , "," )) {
>         gender = "F";
>    } else {
>       gender = "m";
>    }
> </cfscript>

> <cfoutput>#gender#</cfoutput>

> returns F, if I change the first entry in the list to MZ, M gets
> outputted.
> I'm assuming this is because MRS contains 'MR' however I thought the
> whole point of having a listcontainsNocase function (as opposed to using
> contains() ) was that the function would look at each entry as a whole?

Yes listcontainsnocase() is intended to produce this result...

I'd probably use listfindnocase() which is likely to produce the result you
want.

As an asside, I don't think I've used contains() or listcontains() on
anything in about 4 years ... and I've been working with cf for 5, so...
dunno what that says, but I imagine it says something. :P


hth

S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to