Quotation replacement conundrum

This is a discussion on Quotation replacement conundrum within the Cold Fusion forums in Application Servers & Tools category; I have some data stored in a database (user inputted data). I need to display this data within xml, and I need all the quotation marks removed (since that would mess up the xml). The logical replacement (to make it look roughly as the user intended) is to replace the quotation marks with apostrophes. But I run into a problem when I try to use REPLACE (see code below). You'll note I end up with 3 apostrophes in a row in my code. Any ideas on how to handle this? <CFSET thisData = #Replace(oldData, '"', ''', "All")#>...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-25-2008, 02:13 PM
gigasaurus
Guest
 
Default Quotation replacement conundrum

I have some data stored in a database (user inputted data). I need to display
this data within xml, and I need all the quotation marks removed (since that
would mess up the xml). The logical replacement (to make it look roughly as
the user intended) is to replace the quotation marks with apostrophes. But I
run into a problem when I try to use REPLACE (see code below). You'll note I
end up with 3 apostrophes in a row in my code. Any ideas on how to handle
this?

<CFSET thisData = #Replace(oldData, '"', ''', "All")#>

Reply With Quote
  #2  
Old 08-25-2008, 03:15 PM
Dan Bracuk
Guest
 
Default Re: Quotation replacement conundrum

First, take away the octothorps, you don't need them.
Next, surround the apostrophe with double quotes instead of single quotes.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:44 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.