Convert C# "writer.Write(@" to VB ?

  • Thread starter Thread starter bh
  • Start date Start date
B

bh

I'm trying to convert the following statement to VB.NET:
writer.Write(@"<some html here>");

I tried simply removing the semicolon, but VB chokes on the @-sign.
Unfortunately, when searching online, I can't find any information on what
this actually does in the c# code, otherwise I'd simply remove it. What
does the @ symbolize, here, and how can I effectively rewrite this in VB?

Thanks in advance.

bh
 
Take out the @ character. In C# this tells the compiler ignore escape
squences such as "\n" and "\r", etc.

For example: Console.WriteLine("Hello\nWorld") will output :

Hello
World

But Console.WriteLine(@"Hello\World") will output:

Hello\nWorld
 
you can't find any information about it?
In the C#-documentation look for string or string literal.
In short the @ changes the characters and escape sequences that can be used
in a string literal.
since the verbatim string literal is very Basic like, removing the @ will be
right.

(the @ in C# also has another meaning in connection with
keywords/indentifiers)
 
Back
Top