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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using " character in a string???!

Status
Not open for further replies.

Spidy6123

Technical User
May 30, 2002
227
CA
Hey guys,

trying to get " character to pass through a string..
does anyone know how to send special characters through string varaibles?

TIA
 
Try this:
MsgBox "Double quote = "" ? "

Another way is Chr(34)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You can either enclose the double quote in double quotes (e.g. """) or use the Chr() value instead.
Code:
Private Sub Command2_Click()
Text1.Text = Chr(34) & "String" & Chr(34)
'or
Text1.Text = """String"""
End Sub
Both of the above example's will write the text "String" into the textbox.

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I always liked this method:

Code:
Dim Q as String
Q=Chr(34)'Double Quotes
Text1.Text= Q & "String" & Q

Everyone has their own way of doing things, and it's what ever works best for you.

I hope this helps.



Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top