467,132 Members | 1,171 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,132 developers. It's quick & easy.

Console.WriteLine(@"hi");

ae
what is the signficance of the @?
Jul 21 '05 #1
  • viewed: 1154
Share:
2 Replies
ae <ae@discussions.microsoft.com> wrote:
what is the signficance of the @?


See http://www.pobox.com/~skeet/csharp/f...batim.literals

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

"ae" <ae@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.com...
what is the signficance of the @?

Hello ae,

That's a character that tells the compiler to interpret a string verbatim.
It turns a regular-string-literal into a verbatim-string-literal.

If the @ character isn't used, then any backslashes in the string must be
(prepended with a backslash) || (appended with an escape character.)

Here is an example (without/with):

.... "c:\\windows\\system32\\pschdcnt.h";
.... @"c:\windows\system32\pschdcnt.h";
Another use:

.... "Line1\nLine2\nLine3";
.... @"Line1
Line2
Line3"; // multiline goodness. -- jBuelna
J. Buelna - Houston, TX
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by Dave | last post: by
5 posts views Thread by Publicjoe | last post: by
17 posts views Thread by MumboJumbo | last post: by
5 posts views Thread by portroe | last post: by
1 post views Thread by John Wright | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.