locked
How do I put in literal quotes? RRS feed

  • Question

  • I need to know how to put in literal quotes to a variable.  For instance,

    Dim strExample as String

    strExample = "Hello, "My name is Matt""

    lblHello.Text = strExample

    'Output for lblHello on the from would be: Hello, "My name is Matt"

    '''

    Obviously this cannot happen as the " before the M in my will end the statement and the rest will be read as an error.  How do you put in a literal quote?  Like in PHP you put a \ before the quote and it will be treated as a literal quote, I need to do the same thing in visual basic 2005.  Thanks,

    -Matt

    Friday, November 17, 2006 9:50 PM

Answers

  • place double quotes! :-)

    strExample = "Hello, ""My name is Matt"""

    does this work for you?

    Friday, November 17, 2006 9:56 PM

All replies

  • place double quotes! :-)

    strExample = "Hello, ""My name is Matt"""

    does this work for you?

    Friday, November 17, 2006 9:56 PM
  • Thanks, it should work.
    Monday, November 20, 2006 10:28 PM