Embed Quotation Marks

Embed Quotation Marks

You use quotation marks in VB to define strings, but how do you include them in your output? Use whichever of these methods works the best for you:

	Dim strUseChr As String	Dim strUseVar As String	Dim strUseDbl As String		Const Quote As String = """		strUseChr = "Hello " & Chr$(34) & "VB" & _		Chr$(34) & " World!"	strUseVar = "Hello " & Quote & "VB" & _		Quote & " World!"	strUseDbl = "Hello "VB"" World!"		Debug.Print strUseChr	Debug.Print strUseVar	Debug.Print strUseDbl

Each one prints:

	Hello "VB" World!


Share the Post: