Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How can i put a " in the Replace function

How can i put a " in the Replace function

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SekharOne
    wrote on last edited by
    #1

    I am using Replace function to replace the occurance of a double Quote (") in a string. But it shows me error. Can anyone suggest how to achieve that. The code i am using is as given : DocStr = Replace(DocStr, """, "``", 0, , ) Here I want to replace the " with ``. Please Help. Thanks in advance.

    Sekhar :)

    T G 2 Replies Last reply
    0
    • S SekharOne

      I am using Replace function to replace the occurance of a double Quote (") in a string. But it shows me error. Can anyone suggest how to achieve that. The code i am using is as given : DocStr = Replace(DocStr, """, "``", 0, , ) Here I want to replace the " with ``. Please Help. Thanks in advance.

      Sekhar :)

      T Offline
      T Offline
      The ANZAC
      wrote on last edited by
      #2

      As oppose to using """ try using the character code(34). As """ causes a problem (i presume) as " is part of the syntax syntax. e.g. docstr = replace(docstr,chrw(34),"``",0,,)

      Please check out my articles: The ANZAC's articles

      modified on Saturday, January 19, 2008 7:40:16 AM

      1 Reply Last reply
      0
      • S SekharOne

        I am using Replace function to replace the occurance of a double Quote (") in a string. But it shows me error. Can anyone suggest how to achieve that. The code i am using is as given : DocStr = Replace(DocStr, """, "``", 0, , ) Here I want to replace the " with ``. Please Help. Thanks in advance.

        Sekhar :)

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        You use double quotation marks to put a quotation mark in a string: DocStr = Replace(DocStr, """", "``", 0, , ) But why are you replacing the quotation marks with something that looks similar to a quotation mark? I seems like you are trying to circumvent some characters because you don't know how to handle them correctly.

        Experience is the sum of all the mistakes you have done.

        S 1 Reply Last reply
        0
        • G Guffa

          You use double quotation marks to put a quotation mark in a string: DocStr = Replace(DocStr, """", "``", 0, , ) But why are you replacing the quotation marks with something that looks similar to a quotation mark? I seems like you are trying to circumvent some characters because you don't know how to handle them correctly.

          Experience is the sum of all the mistakes you have done.

          S Offline
          S Offline
          SekharOne
          wrote on last edited by
          #4

          Yes I want to replace the double quotes from a string that I have retrieved. How can i replace the double quotes from a string using the replace() function. Please Help.

          Sekhar :)

          G 1 Reply Last reply
          0
          • S SekharOne

            Yes I want to replace the double quotes from a string that I have retrieved. How can i replace the double quotes from a string using the replace() function. Please Help.

            Sekhar :)

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            Eh...? You didn't read my previous post, you just replied to it anyway?

            Experience is the sum of all the mistakes you have done.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups