sanjshah12
asked on
Replace characters from string
Hi,
I'm rying to replace some special characters from a string before submittng to a DB, in particualr the ", I know I can use the replace command but cannot get this working for " with '
MyComments = Request.Form("comments")
MyComments = Replace(MyComments ,"""","'")
I'm rying to replace some special characters from a string before submittng to a DB, in particualr the ", I know I can use the replace command but cannot get this working for " with '
MyComments = Request.Form("comments")
MyComments = Replace(MyComments ,"""","'")
ASKER
Thanks for the reply, I get an error with the script
Microsoft VBScript compilation error '800a0409'
Unterminated string constant
/AddComments.asp, line 39
chr(34) = "
-----------^
Microsoft VBScript compilation error '800a0409'
Unterminated string constant
/AddComments.asp, line 39
chr(34) = "
-----------^
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cool thanks - apologies about the comment - it was me being daft! thanks again!
No worries - glad I could help. Thanx for the grade! :^)
chr(34) = "
chr(39) = '
MyComments = Request.Form("comments")
MyComments = Replace(MyComments ,chr(34),chr(39))