Need help translating a string constant that uses "@" ampersand from C# to VB.Net

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

In a lot of C# code I've gotten from downloading from
www.codeproject.com, I see that string constants have an ampersand
infront of them. Can I just take it off when translating to VB.Net,
or does it mean something?

Also, are we allowed to use the code in our applications from sites
like these? Asking about plagiarizing issues. What's the normal rule
of thumb.

Thanks...
 
Greets,

I think you are referring to the "at" (@) symbol which prefixes the C#
strings. In VB.NET, this is not used. It is a shortcut in C# so that the
'\' (backslash) doesn't require escaping in C# string literals. For
example:

"C:\\Temp\\file.txt" // requires '\' to be escaped
@"C:\Temp\file.txt" // '\' doesn't need to be escaped.

As far as copyright restrictions go, each site (and/or individual)
usually specify what conditions there are for code reuse or resubmission.
Same may fall under the GNU public license, while others may just require
you keep any of their copyright notices.

Regards,

Joe
 
Back
Top