<cfset firstWordBreak = find(' ',search,1)>
<cfif firstWordBreak>
<cfset secondWordBreak = find('
',search,firstWordBreak)>
</cfif>
<cfif isDefined("secondWordBreak") and secondWordBreak>
<cfset thirdWordBreak = find('
',search,secondWordBreak)>
</cfif>
<cfif isDefined("thirdWordBreak") and thirdWordBreak>
<cfset fourthWordBreak = find('
',search,thirdWordBreak)>
</cfif>
got it.
thats what ill do, then mid the strings out, and build the dynamic query
based on the presence of a 1st, 2nd, 3rd, or 4th word that may be there,
should i make them separate by commas, since st. anne would return, st.
joseph as well as many other possibilities, but if i make them separate
by commas, then ill be good, cause they will be separating it
themselves, and then i can just find commas....more reliable i think.
huh?
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 10:17 PM
To: CF-Talk
Subject: count and strip words from string.
lets say, a user enters "skateboarding atlanta half-pipe"
and you wanted to break that up into separate words, and know that
there should be 3 "...or searchTerm like '%wordHere%'" sections in a
query
(one for each word) so that the user can search for "skateboarding or
atlanta or
half-pipe" through a sql statement.
is this feasible, i know it has to be, just cant think past my keyboard
right now.
thanks for any ideas....
....tony
tony weeg
[EMAIL PROTECTED]
www.revolutionwebdesign.com
rEvOlUtIoN wEb DeSiGn
410.334.6331
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm