Is it possible to place quotations in a sentence thats in quotations
For example:
What is the proper way to place quotations inside quotationsCode:TextBox2.Text = "My name is "Sunshine" today"
Printable View
Is it possible to place quotations in a sentence thats in quotations
For example:
What is the proper way to place quotations inside quotationsCode:TextBox2.Text = "My name is "Sunshine" today"
There are a few methods to do this like using hte Chr(34) instead of the actual double quote character or whatever but they are all just preferences as not much difference in resource useage.Code:TextBox2.Text = "My name is ""Sunshine"" today"
:)
Hey Rob can you give me a Code example
Another would be...
Code:TextBox2.Text = "My name is " & Chr(34) & "Sunshine" & Chr(34) & " today"
Okay that worked but
Is there a way i can just place one "
Because for that code it requires me to use both on "Sunshine" and i just need to have one.
Example:
But if i don't close the name sunshine it will keep quoting until the next ".Code:"My name is " & Chr(34) & "Sunshine & Chr(34) & " today"
Your missing a double quote after sunshine.
Thats how i need it to be because after "Sunshine" there will be a number added to it. from another textbox in the same quotation.Quote:
Originally Posted by RobDog888
Example:
Resulting in this:Code:TextBox2.Text = "My name is " & Chr(34) & "Sunshine" & Chr(34) & Textbox1.Text & Chr(34) & " & Chr(34)
My name is "Sunshine27" today
Basically my question would be: Can i have a single " in a & Chr(34) & Like this:
Code:& Chr(34) " Chr(34) &
When in a string, either " & Chr(34) & " or "" produce a single quotation character (Chr(34) returns a string containing just a single quotation character, and "" is a built-in 'trick' to allow you to use the character within a string).
To have two quotation characters in your string, you can use either " & Chr(34) & Chr(34) & " or """"
Just place a variable to contain the number you want to concatenate with Sunshine.
Code:TextBox2.Text = "My name is " & Chr(34) & "Sunshine" & SomeVar & Chr(34) & Textbox1.Text & Chr(34) & " & Chr(34)
Awesome! Thanks again RobDog888 and si_the_geek !!
This worked