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 to Pass a Double Quote (")in a string ?

How to Pass a Double Quote (")in a string ?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
4 Posts 4 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 want to put a Double Quote (") in a string. if I give it in a string, then the string terminates at the position where the Double Quote is put. Can anybody suggest how to put a Double Quote in a string ? Thanks In advance.

    Sekhar :)

    N J T 3 Replies Last reply
    0
    • S SekharOne

      I want to put a Double Quote (") in a string. if I give it in a string, then the string terminates at the position where the Double Quote is put. Can anybody suggest how to put a Double Quote in a string ? Thanks In advance.

      Sekhar :)

      N Offline
      N Offline
      Nilesh Hapse
      wrote on last edited by
      #2

      Try """". e.g. "This is a ""TEST"" string"

      1 Reply Last reply
      0
      • S SekharOne

        I want to put a Double Quote (") in a string. if I give it in a string, then the string terminates at the position where the Double Quote is put. Can anybody suggest how to put a Double Quote in a string ? Thanks In advance.

        Sekhar :)

        J Offline
        J Offline
        John_Adams
        wrote on last edited by
        #3

        Hi, In regards to your query I would like to inform you that in order to print double qoutes in a sting we have to use two double quotes (e.g., ""). We can print the double quotes in a string as follows: BEGIN CODE Dim str As String = "I ""Love"" VB " MsgBox(str) END CODE The output will be I "Love" VB. I hope this helps :).

        Regards, John Adams ComponentOne LLC

        1 Reply Last reply
        0
        • S SekharOne

          I want to put a Double Quote (") in a string. if I give it in a string, then the string terminates at the position where the Double Quote is put. Can anybody suggest how to put a Double Quote in a string ? Thanks In advance.

          Sekhar :)

          T Offline
          T Offline
          The Mighty Atom
          wrote on last edited by
          #4

          Use ChrW(34) Like this: TextBox1.Text = ChrW(34) & "This is a string." & ChrW(34) The output would be: "This is a string." You can put any character in ChrW(.) by looking at this page: http://www.utoronto.ca/webdocs/HTMLdocs/NewHTML/iso_table.html[^] As you can see, the double quote char is decimal 34.

          http://www.themightyatom.nl

          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