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

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...
 
J

Joe Delekto

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
 

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

Top