Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Replacing quotation marks

Reply
Thread Tools

Replacing quotation marks

 
 
J. Muenchbourg
Guest
Posts: n/a
 
      08-19-2003
The following removes any unwanted apostrophes before being inserted
into an sql database:

Articletext = replace(articleText,"'","''")

..but if I need to remove all quotation marks, this doesnt work:

Articletext = replace(articleText,""","''")


????
Muench

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
John Beschler
Guest
Posts: n/a
 
      08-19-2003
"" = empty string
""" = empty string + extra "

To place a " into a string use "".

Your code would then be:
Articletext = replace(articleText,"""","''")
or alternately:
Articletext = replace(articleText,CHR(34),"''")

HTH,
John





>-----Original Message-----
>The following removes any unwanted apostrophes before

being inserted
>into an sql database:
>
>Articletext = replace(articleText,"'","''")
>
>..but if I need to remove all quotation marks, this

doesnt work:
>
>Articletext = replace(articleText,""","''")
>
>
>????
>Muench
>
>*** Sent via Developersdex http://www.developersdex.com

***
>Don't just participate in USENET...get rewarded for it!
>.
>

 
Reply With Quote
 
 
 
 
Alan
Guest
Posts: n/a
 
      08-19-2003
You need to double-up apostrophes to stop them interfering with the
delimiters needed around textual column contents - why do you need to
double-up quotes?

Alan

"J. Muenchbourg" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> The following removes any unwanted apostrophes before being inserted
> into an sql database:
>
> Articletext = replace(articleText,"'","''")
>
> .but if I need to remove all quotation marks, this doesnt work:
>
> Articletext = replace(articleText,""","''")
>
>
> ????
> Muench
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for a Firefox extension involving quotation marks Teh Suck Firefox 0 01-17-2006 09:00 AM
Quotation marks when mixing jsp and html forms deepstar@gmail.com Java 0 11-15-2005 06:26 PM
Using quotation marks Radith Java 1 01-07-2005 12:59 AM
String and quotation marks M. Clift Python 2 10-22-2004 09:01 PM
<q> and language-specific quotation marks Tristan Miller HTML 54 11-06-2003 05:19 PM



Advertisments