How to add double quotes in a string literal

前端 未结 7 1980
孤街浪徒
孤街浪徒 2021-01-17 15:09

Example code:

Dim a As String
a = 1234,5678,9123

I want to add literal double quotes to the variable a

Expected Output

7条回答
  •  清歌不尽
    2021-01-17 15:58

    To make Chr$(34) more readable:

    Dim quote as string
    quote = Chr$(34)
    a = quote & "1234,5678,9123" & quote
    

    This makes it easier to get the correct number of " symbols everywhere and is readable.

提交回复
热议问题