|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Convert C# "writer.Write(@" to VB ?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 The "@" sign makes it a verbatim string, so you don't need to escape
backslashes. More info: http://www.c-sharpcorner.com/1/verbatim_literals.asp bh wrote: Show quoteHide quote > 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 Show quoteHide quote "bh" wrote: > 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 > > > 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) Show quoteHide quote "bh" <NoSpam@ReplyToGroup.com> schrieb im Newsbeitrag news:%23h5efVh7GHA.3644@TK2MSFTNGP03.phx.gbl... > 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 > vb doesn't require the "@" sign -- dump it too..
Show quoteHide quote "bh" <NoSpam@ReplyToGroup.com> wrote in message news:%23h5efVh7GHA.3644@TK2MSFTNGP03.phx.gbl... > 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 > "bh" <NoSpam@ReplyToGroup.com> schrieb: Simply remove the '@':> I'm trying to convert the following statement to VB.NET: > writer.Write(@"<some html here>"); C# Programmer's Reference -- 'string' <URL:http://msdn.microsoft.com/library/en-us/csref/html/vclrfString.asp> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> |
|||||||||||||||||||||||