Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace double quotes

Status
Not open for further replies.

spud101

Programmer
Nov 13, 2002
9
CA
I'm trying to replace all the double quotes in a string with 2 double quotes.
Ex.

this is a "string" with quotes

I want to change it to this:

this is a ""string"" with quotes

The replace function gives me an error when i use it like this:

replace(thestring,""","""")

i also tried:
replace( thestring,chr(34),"""")- no error but the output is the same with only 1 set of double quotes.

Any ideas?
Thanks
 
Hello spud101,

You've got it already. Just use chr(34) more thoroughly.
Code:
    replace(thestring,chr(34),chr(34)&chr(34))
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top