March 29th, 2003, 02:19 PM
Easy VB Question
I'm trying to assign a string such as "Hello World" to a variable. The trick is, is that I also want to include the quotes around the string. How can this be done in VB?
I know in C/C++/Java, you just use escape characters so you can make an assignment like
How do you do that in VB?
March 29th, 2003, 07:45 PM
Just drawing on my old experience with BASIC -- I have made a few half-hearted stabs at VB, only to be frustrated by the development environment and and end up home-sick for the expressiveness of C++.
We used to be able to use either single quotes or double quotes to create a string literal. You could try (spaces inserted to separate the quote marks):
' "Hello, World" '
If that doesn't work, then you could try doubling the quotemarks:
""Hello, World"" (" "Hello, World" ")
March 29th, 2003, 07:53 PM
double the double qoutes is how u escape it in VB
x = """Hello World"""
or use the chr() function but I am not sure exactly what was the number for qoute
but assuming it is y
x = chr(y) & "Hello World" & chr(y)