VB.NET
Dim str As String = "Example String " & """" & "This is the String with double quotes." & """"
MessageBox.Show(str)
In VB.Net you can indicate that there is a double quote in a string by using 4 double quotes ("""").
C#.NET
string str = "Example String " + "\"" + "This is the String with double quotes." + "\"";
MessageBox.Show(str);
As you will notice in C# the double quote can be represented as double quote, back slash and again using two double quotes ("\"").
The above string will be displayed as follows.
11 comments:
thanx
thanx, that solve my problem.
Thanx Man U r G8...
Thanks Gud one. Solved my prob.
An impressive share! I have just forwarded this onto a co-worker who was doing a little research on this.
And he actually ordered me lunch due to the fact that I discovered it for
him... lol. So allow me to reword this.... Thanks for
the meal!! But yeah, thanx for spending the time to talk about this subject here on your web site.
My web site :: Poesie
thankyouuuuu so much
Thnx
I need help with a VB program I am working on this is what I have and it doesn't work. I need to combine the text box text, and the comment I wrote in.
Private Sub txtcomment_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtcomment.TextChanged
comment = "" & txtcomment.Text + "You have: " + time + " seconds until your computer shuts down. :)" & ""
End Sub
Help thanks!
Use multiple double quotes to make them appear in your output.
Try to get an idea using the below code.
Let me know if you still have problems.
Dim time As String = "60"
' If you need to use a quoteation in a variable use 4 quotes as in the begining of the following code.
Dim comment As String = """" & txtcomment.Text + "You have: " + time + " seconds until your computer shuts down. :)"""
MsgBox(comment)
MsgBox("""" & txtcomment.Text + "You have: " + time + " seconds until your computer shuts down. :)""")
MsgBox("""Text with double quotes.""")
Many thanks Arjuna! This is one of those nuggets that leaves you thinking 'Why don't I know this?!'... but only when you need it!
Hello! I really liked your forum, especially this section. I just signed up and immediately decided to introduce myself, if I'm wrong section, ask the moderators to move the topic to the right place, hopefully it will take me well... My name is Igor, me 34 years, humourist and serious man in one person. Ssory for my English.
Post a Comment