Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting escape characters?

Status
Not open for further replies.

stevepuri

Programmer
Mar 30, 2001
24
0
0
US
Hey,

Does anyone know how to output
the double-quote " character
in VBScript? (Escape characters)

For example, in JavaScript, the
following would output
(with double-quotes)
the string "Hello, world!"
in a message-box:

Code:
	alert("\"Hello, world!\"");

The VBScript equivalent?
This does NOT work:

Code:
	MsgBox("\"Hello, world!\"")

Thanks,
Steve.
 
Use "" to get double quotes to show up or Chr(34)

Ex:
MsgBox("""Hello World!""")
or
MsgBox(Chr(34) & "Hello World!" & Chr(34))

both output "Hello World!"

hope this helps
leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top