I would probably consider changing the database first. Outside of that, you
can use regex:

<CFSET STR = """Ray's world has ""quotes"" in it.""">
<CFSET STR = REReplace(STR,"^""","")>
<CFSET STR = REReplace(STR,"""$","")>

This uses ^" to find a quote at the beginning, and "$ to match at the end.
This will keep the "quotes" in the middle of the string safe. If you are
_sure_ that every string has "..", you could also do:

<CFSET NewStr = Mid(STR,2,Len(STR)-2)>

Oh, you also may be able to use SQL to strip out the first and last
character. Not 100% sure though.

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: Marc Garrett [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 21, 2001 11:55 AM
> To: CF-Talk
> Subject: Stripping wrapper quotes from all fields
>
>
> I have a database in which all fields are wrapped by double
> quotes. I'd like to write a CF template that will strip all
> leading and ending quotes from all fields in the table; i.e.,
>
> "Hardwood Tile" should become Hardwood Tile
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to