By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,165 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,165 IT Pros & Developers. It's quick & easy.

How to include " in string

P: n/a
Can somebody please help me and tell me how to include the " symbol in a
string?

Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
use "" (two double-quotes)
for example -

Dim str As String = "test ""string"""
Console.WriteLine(str)

Output:
test "string"

Imran.

"Colmag" <Co****@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com...
Can somebody please help me and tell me how to include the " symbol in a
string?

Nov 21 '05 #2

P: n/a
""

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Colmag" <Co****@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com...
Can somebody please help me and tell me how to include the " symbol in a
string?

Nov 21 '05 #3

P: n/a
As is always the case, I look for half an hour, post a question on here, then
work out the answer... (chr(34)).

"Colmag" wrote:
Can somebody please help me and tell me how to include the " symbol in a
string?

Nov 21 '05 #4

P: n/a


I use this quote mark (39)

Dim QM As String = Chr(39)

"Colmag" <Co****@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.com...
As is always the case, I look for half an hour, post a question on here,
then
work out the answer... (chr(34)).

"Colmag" wrote:
Can somebody please help me and tell me how to include the " symbol in a
string?

Nov 21 '05 #5

P: n/a
"Colmag" <Co****@discussions.microsoft.com> schrieb:
how to include the " symbol in a
string?


\\\
Dim s As String = _
"He said: ""Hello World!"""
Dim t As String = _
"He said: " & ControlChars.Quote & "Hello World!" & ControlChars.Quote
///

Notice that there is no performance loss in using the string
concatenation operator in the 2nd sample, the string is concatenated by
the compiler and stored as a single constant in the assembly.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.