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

How do you Replace() using the double-quote character?

Contributor ,
Jul 21, 2006 Jul 21, 2006
I want to get rid of Word's curly quotes. Quite frankly, I can use ColdFusion's standard replace(... by pasting in an unwanted character.

Example - I can paste in a curly quote and replace it with a tildi ~ without a problem.

But, I cannot replace it with a doubleQuote mark.

I've tried escaping it like """", as in replace("x", """" .... but am not successful.

Any ideas?
TOPICS
Advanced techniques
4.8K
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
LEGEND ,
Jul 21, 2006 Jul 21, 2006
Mix your quote types.

replace('x','"'...)



Karen_Little wrote:
> I want to get rid of Word's curly quotes. Quite frankly, I can use ColdFusion's
> standard replace(... by pasting in an unwanted character.
>
> Example - I can paste in a curly quote and replace it with a tildi ~ without a
> problem.
>
> But, I cannot replace it with a doubleQuote mark.
>
> I've tried escaping it like """", as in replace("x", """" .... but am not
> successful.
>
> Any ideas?
>
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
Contributor ,
Jul 21, 2006 Jul 21, 2006
Absolutely nothing I've tried works, including replace(variable, 'a', ':', 'all') (system won't accept the 'all') or replace(variable, "a", "'''"", "all")

I've even been trying scripts -- I cannot get a " to replace anything else. Generally, when I return the string, the majority of it just disappears, otherwise, I get an error message about the line with replace()
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
Mentor ,
Jul 21, 2006 Jul 21, 2006
Did you try using the CHR() function? CHR(34) = "

replace(variable, "a", chr(34), "all")

Phil
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
Contributor ,
Jul 21, 2006 Jul 21, 2006
That one worked . . . thanks!
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
LEGEND ,
Jul 22, 2006 Jul 22, 2006
> That one worked . . . thanks!

I would remain concerned, though, if '"' or """" did not work. It suggests
there's something wrong with your CF install (can't think what else it
would be).

Can you post the entire code block of an example that DIDN'T work?

--
Adam
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
Contributor ,
Jul 23, 2006 Jul 23, 2006
LATEST
Hi - I spent 14 hours yesterday finishing my application and just used what worked. I'll try to reproduce the error early this week and will get back to you.
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