Copy link to clipboard
Copied
I have built a Coldfusion page which brings database info to the page. In the database the inputters have used ampersands (&) instead of 'and'. How can I search and replace using Coldfusion within the existing page?
Copy link to clipboard
Copied
content = replace(content, " & ", " and ", "all")
Copy link to clipboard
Copied
I am a relative newcomer to Coldfusion so this might appear a silly question, where do I put this "content = replace(content, " & ", " and ", "all")"?
Copy link to clipboard
Copied
OK, so assume you have data coming out of a database, say maybe the query
is called "pageData" and the column is called "content".
Instead of just doing this:
#replace(pageData.content, " & ", " and ", "all")#</cfoutput