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

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

Contributor ,
Jul 21, 2006 Jul 21, 2006

Copy link to clipboard

Copied

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

Views

4.2K

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?
>

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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()

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Did you try using the CHR() function? CHR(34) = "

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

Phil

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

That one worked . . . thanks!

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

> 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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
Documentation