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. easy question...... I am having dumb moment.

easy question...... I am having dumb moment.

Scheduled Pinned Locked Moved Visual Basic
questioncsharphelp
9 Posts 8 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.
  • C Offline
    C Offline
    Cory Kimble
    wrote on last edited by
    #1

    i have looked in my books, I have looked online, I have looked in code Project. Why can't I find this simple answer to my question. I must not be working it correctly on the search engines. Maybe someone here can help me. Here is goes. This should be a no brainer. I want to write to a file. I want to put a literal " in the string. How do I do that in Vb .net? I tried """ with no luck. So, does anyone know this answer that I should probably be able to recite in my sleep.

    C R M L 4 Replies Last reply
    0
    • C Cory Kimble

      i have looked in my books, I have looked online, I have looked in code Project. Why can't I find this simple answer to my question. I must not be working it correctly on the search engines. Maybe someone here can help me. Here is goes. This should be a no brainer. I want to write to a file. I want to put a literal " in the string. How do I do that in Vb .net? I tried """ with no luck. So, does anyone know this answer that I should probably be able to recite in my sleep.

      C Offline
      C Offline
      Chinners
      wrote on last edited by
      #2

      try adding an extra ": stream.write("""") will write " and stream.write("""Hello""") will write "Hello"

      1 Reply Last reply
      0
      • C Cory Kimble

        i have looked in my books, I have looked online, I have looked in code Project. Why can't I find this simple answer to my question. I must not be working it correctly on the search engines. Maybe someone here can help me. Here is goes. This should be a no brainer. I want to write to a file. I want to put a literal " in the string. How do I do that in Vb .net? I tried """ with no luck. So, does anyone know this answer that I should probably be able to recite in my sleep.

        R Offline
        R Offline
        Rob Smiley
        wrote on last edited by
        #3

        Use 4 double quotes. One for each of start and end of string, 1 as an escape character and 1 for the string content. Great syntax vb uses here!

        "An eye for an eye only ends up making the whole world blind"

        V 1 Reply Last reply
        0
        • C Cory Kimble

          i have looked in my books, I have looked online, I have looked in code Project. Why can't I find this simple answer to my question. I must not be working it correctly on the search engines. Maybe someone here can help me. Here is goes. This should be a no brainer. I want to write to a file. I want to put a literal " in the string. How do I do that in Vb .net? I tried """ with no luck. So, does anyone know this answer that I should probably be able to recite in my sleep.

          M Offline
          M Offline
          Mitch F
          wrote on last edited by
          #4

          In addition to the above posts, if you have to add a lot of quotes as you are creating a string, I would suggest creating a quote String and then just add it wherever you need a quote. Dim quoteStr As String = """" MsgBox(quoteStr + "Hello" + quoteStr) It makes it easier to read if you are working with lots of strings.

          1 Reply Last reply
          0
          • C Cory Kimble

            i have looked in my books, I have looked online, I have looked in code Project. Why can't I find this simple answer to my question. I must not be working it correctly on the search engines. Maybe someone here can help me. Here is goes. This should be a no brainer. I want to write to a file. I want to put a literal " in the string. How do I do that in Vb .net? I tried """ with no luck. So, does anyone know this answer that I should probably be able to recite in my sleep.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            You can also do Chr(34) where you want the quotes.

            MsgBox(Chr(34) & "This is in quotes." & Chr(34))

            C 1 Reply Last reply
            0
            • L Lost User

              You can also do Chr(34) where you want the quotes.

              MsgBox(Chr(34) & "This is in quotes." & Chr(34))

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              But that's just nasty as all hell, obviously.

              Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              L T 2 Replies Last reply
              0
              • R Rob Smiley

                Use 4 double quotes. One for each of start and end of string, 1 as an escape character and 1 for the string content. Great syntax vb uses here!

                "An eye for an eye only ends up making the whole world blind"

                V Offline
                V Offline
                Vasudevan Deepak Kumar
                wrote on last edited by
                #7

                Rob Smiley wrote:

                Great syntax vb uses here!

                That'z VB. :)

                Vasudevan Deepak Kumar Personal Homepage
                Tech Gossips
                A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

                1 Reply Last reply
                0
                • C Christian Graus

                  But that's just nasty as all hell, obviously.

                  Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Yes it is.

                  1 Reply Last reply
                  0
                  • C Christian Graus

                    But that's just nasty as all hell, obviously.

                    Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                    T Offline
                    T Offline
                    Thomas Stockwell
                    wrote on last edited by
                    #9

                    When I am not in C# I still use the Convert.ToChar(10)+Convert.ToChar(13) for a return/newline character.

                    Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios Discounted or Free Software for Students: DreamSpark - downloads.channel8.msdn.com MSDN Academic Alliance - www.msdnaa.com

                    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