Professional Web Applications Themes

Replacing quotation marks - ASP

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 [url]http://www.developersdex.com[/url] *** Don't just participate in USENET...get rewarded for it!...

  1. #1

    Default Replacing quotation marks

    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 [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    J. Muenchbourg Guest

  2. #2

    Default Replacing quotation marks

    "" = 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 [url]http://www.developersdex.com[/url]
    ***
    >Don't just participate in USENET...get rewarded for it!
    >.
    >
    John Beschler Guest

  3. #3

    Default Re: Replacing quotation marks

    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" <jodaddycanada.com> wrote in message
    news:#w4TLrnZDHA.2520TK2MSFTNGP09.phx.gbl...
    > 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 [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Alan Guest

  4. #4

    Default Replacing quotation marks

    I have been given this string that contains a quotation mark

    myString = "the length is 24" long"

    how can i replace the " after 24 with the word inches.

    i used this to remove any commas from a string

    repeat while (thestring contains ",")
    thePos = offset(",",theString)
    put " "into theString.char[thePos]
    end repeat

    it doesnt work for a quotation

    thanks




    action bolt webforumsuser@macromedia.com Guest

  5. #5

    Default Re: Replacing quotation marks

    -- Welcome to Director --
    s="abc"&quote&"def"
    put s
    -- "abc"def"
    put offset(quote, s)
    -- 4
    put "inches" into char 4 of s
    put s
    -- "abcinchesdef"

    Andrew
    Andrew Morton Guest

  6. #6

    Default Re:Replacing quotation marks

    <<I have been given this string that contains a quotation mark

    myString = "the length is 24" long"

    how can i replace the " after 24 with the word inches.

    i used this to remove any commas from a string

    repeat while (thestring contains ",")
    thePos = offset(",",theString)
    put " "into theString.char[thePos]
    end repeat

    it doesnt work for a quotation

    thanks>>

    It should work if you sub the key word QUOTE (no quotes around it)

    repeat while (thestring contains QUOTE)

    Gretchen Macdowall
    updateStage, inc.
    Gretchen webforumsuser@macromedia.com Guest

  7. #7

    Default Re: Replacing quotation marks

    --

    P.S. "The length is 24" long" is poor English. It should be "the length is 24""
    or "it is 24" long".

    Andrew

    Andrew Morton Guest

Similar Threads

  1. Garamond Premier Pro: quotation marks?
    By George_Papoon@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 3
    Last Post: July 18th, 01:06 AM
  2. anybody getting quotation marks
    By mgarbe in forum Macromedia Flash Player
    Replies: 1
    Last Post: May 11th, 08:16 PM
  3. CFSET and Quotation Marks
    By fs22 in forum Coldfusion - Advanced Techniques
    Replies: 4
    Last Post: April 29th, 03:34 PM
  4. Tyogrpaher's Quotation Marks?
    By greenchain webforumsuser@macromedia.com in forum Macromedia Fireworks
    Replies: 4
    Last Post: August 27th, 08:40 PM
  5. Quotation marks
    By Pyro Dude webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 2
    Last Post: July 15th, 05:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139