Search code examples
vb6double-quotes

How to add double quotes in a string literal


Example code:

Dim a As String
a = 1234,5678,9123

I want to add literal double quotes to the variable a

Expected Output:

a = "1234,5678,9123"

How do I format the string so when I print it, it has double quotes around it?


Solution

  • If you want to include " in a string, supply "" where you want the quote to appear. So your example should read...

    a = """1234,5678,9123"""