String Literals

Steven McDonald

Well-known member
Joined
Jun 14, 2005
Messages
48
Location
South Africa
Programming Experience
Beginner
Does vb.Net have a string literal function like C#?

I studied C# and am now working in vb.Net and in C# you can create a string:
string s = @"One
Two
Three"

And thats how it would print it wherever. Is it possible in vb.Net?
 
There is no eqivalent in VB.NET. It's generally not as important because there are fewer characters that get escaped in VB. Also, VB.NET does not have an end-of-line indicator like the semicolon in C#. In VB.NET, the end of the physical line is the end of the line of code, unless you end it with the line continuation characters, which are an underscore preceeded by a space. You cannot use this within a string, though. You have to end the string with a double quote, continue the line and concatenate with another string.
 
Back
Top