Right, I'm having a dead-brain moment here. The code below may not be
the best, but it does its job well enough apart from the problem I'm
having, of course :)
<cfset findthis = "UK,Australia,South Africa">
<cfset inthis = "UK Hello and welcome to <b> the list</b>.australia
south africa This is it!">
<Cfloop list="#findthis#" delimiters="," index="i">
<cfset customSearch = Refindnocase("#i#",
inthis, 1)>
<Cfif CustomSearch GT 0>
<Cfoutput>
Found #i#
</CFOUTPUT>
</cfif>
</cfloop>
I need to keep the cfloop as it is really, so any changes would best be
done in the refindnocase itself if that's possible. The problem is that
in this example, #i# would find all 3. I only ever want it to return
the first *found* country. I'm already limiting the text-to-be-searched
by 30 characters, but on occasions, more than 1 country is being found
and it's just making things screw up. What I want to tell it, is: "Find
one of these countries, but make sure if you find more than one that you
only choose the one the farthest to the left!"
Can anyone decipher my question/problem, let alone suggest a solution?
Cheers
Will
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community.
http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4