You don't actually need to remove them from the list, just from the string
in the loop, so....
<cfif #left('#keyword#',1)# is '"'>
<cfquery>
<!-- Query stuff in here --->
where <cfloop list="#keyword#" index="keywords" delimiters='"'>
name LIKE '%#trim(keywords)#%' or
</cfloop>0=1
</cfquery>
</cfif>
...should work.
Your bigger worry is the if statement at the top, what is it's purpose? I
could be wrong having not seen the rest of the code but I think it is
totally unnecessary.
Also if someone was to enter "w1 w2" w3 w4 as their search string your query
would search for w1 and w2 together and then w3 and w4 together as there is
no quote between them to delimit them in the list.
There are many ways you could solve this, and more experienced people than I
will read this and give you a better solution than I ever could, but you
need to put some more thought into your query by the looks of things.
--
James Smith - [EMAIL PROTECTED]
http://ask-ted.com - Thiele Euronet Directories Limited
=====================================================================
VI VI VI The editor of the beast.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 25, 2000 8:21 PM
Subject: Removing a character from a list?
> Hey all, I have a question that is probably a bit of a basic list
question.
>
> I am doing a search kind of situation, and I'm trying to make it a little
> intelligent. Basically, if there are quotes, search for literal matches,
if
> not, check for spaces. That kind of thing.
>
> Well, my question is, if they enter "word1 word2" word3, then it
searches
> for that last word with a space in front of it, so it finds nothing.
> How do I remove that space? So that it searches for "word1 word2" and
> then for "word3"?
>
> What I have so far is
>
> <cfif #left('#keyword#',1)# is '"'>
> <cfquery>
> <!-- Query stuff in here --->
> where <cfloop list="#keyword#" index="keywords" delimiters='"'> name LIKE
> '%#keywords#%' or</cfloop> 0=1
> </cfquery>
>
> Stuart D.
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.