Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to do a replace on a sting witch contains an ASCII Char

Explorer ,
Oct 30, 2013 Oct 30, 2013

Hi All,

I have a string named 'EMAIL_BODY' which contains the following text 'Blah blah &#39 blah blah'  What I want to do is replace &#39 with '

How am I able to do this? as I think I need to escapse the & and # ?

Many thanks,

George

420
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Oct 30, 2013 Oct 30, 2013

Well if you're using the # in CFML you'll most likely need to escape references to it by using ## instead.

<cfset EMAIL_BODY = "Blah blah &##39 blah blah">

<cfset newBODY = replace(EMAIL_BODY, "&##39", "&##39;", "ALL")>

<cfdump var="#variables#">

Translate
Engaged ,
Oct 30, 2013 Oct 30, 2013
LATEST

Well if you're using the # in CFML you'll most likely need to escape references to it by using ## instead.

<cfset EMAIL_BODY = "Blah blah &##39 blah blah">

<cfset newBODY = replace(EMAIL_BODY, "&##39", "&##39;", "ALL")>

<cfdump var="#variables#">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources