devxlogo

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!

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Five Early Architecture Decisions That Quietly Get Expensive

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.