What is the purpose of @ here?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: What is the purpose of @ here?

  1. #1
    Join Date
    Jul 2005
    Posts
    966

    What is the purpose of @ here?

    Here is the example,
    Code:
    string ex = @"This has a carriage return\r\n"
    Thanks.

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,006

    Re: What is the purpose of @ here?

    It declares the string to be literal. It will therefore NOT interpret \r as a carriage return escape sequence and \n as a newline escape sequence. Read more at http://msdn.microsoft.com/en-us/libr...(v=vs.71).aspx
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    Arjay's Avatar
    Arjay is online now Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,480

    Re: What is the purpose of @ here?

    Quote Originally Posted by LarryChen View Post
    Here is the example,
    Code:
    string ex = @"This has a carriage return\r\n"
    Thanks.
    Really, Larry? Instead of posting a question like this to the forum, why not remove the @ and see what happens? Then look in msdn if you still have questions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center