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

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
 
G

Guest

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
 
C

Christof Nordiek

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top