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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replacing double quotes 1

Status
Not open for further replies.

Jorgandr

Programmer
May 10, 2002
58
US
Is there a way to replace double quotes in ASP? I usually use the Replace function but I'm not sure how to use it to include double quotes " I need to change them all to \" so that when they are inserted into my javascript function it will display the double quotes and not give me an error. Thanks
 
I think replace function is the best way to go. Replace any " with \"" in javascript. [i.e. Replace(rs("description"), """", "\""\""") ]

also, if you're not going to be inserting the description into a text field/area...but rather on an html page, you could use """ to display a quote in an html page.

Hope these help. -Ovatvvon :-Q
 
Sorry, shoulda been:

Replace(rs("description"), """""", "\""\""")

if you were talking about double quotes. -Ovatvvon :-Q
 
You can use double double quotes in the replace statement, so...

Replace(variable, """", "'")

...would replace a double quote with a single quote in "variable".
 
/me needs to read the problem descriptions a little better. ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top