using the quote mark in a string

  • Thread starter Thread starter Rory Becker
  • Start date Start date
R

Rory Becker

Is there a way to include the quote mark/character when using the
MessageBox.Show?
In other words is there an alternative/secondary delimiter for strings
in
VB2005?

No secondary delimiter but it can escape itself.

thus...
 
You should use double quote marks if you want to print a quotemark.

For example:

txtText.Text = "Hello World"

MessageBox.Show("""" & txtText.Text & """" & " is plain text in quotes")

Will display a messagebox with the following text:

"Hello World" is plain text in quotes

Regards,

Michel Bechelani
 
Two adjacent quotes:

MessageBox.Show(" "" " & txtText.Text & " "" is plain text in
quotes", "Text Box")

MessageBox.Show("""This"" is quoted", "Text Box")

MessageBox.Show("I'm quoting ""This""", "Text Box")

MessageBox.Show("""", "Text Box")
 
Is there a way to include the quote mark/character when using the
MessageBox.Show?
In other words is there an alternative/secondary delimiter for strings in
VB2005?
<"> denotes the desired use/position of the quote mark/character:

MessageBox.Show( <"> & txtText.Text & <"> & " is plain text in quotes",
"Text Box")

The [escape character set/usage] does not seem to include the quote mark
(\").
Thanks, Tracey
The following appears to work OK for the apostrophe:
MessageBox.Show(" ' " & txtText.Text & " ' " & " is plain text in
apostrophes", "Text Box")
 
Back
Top