none
what does @ mean? RRS feed

  • Question

  • what does @ mean, in C#?

    String var = @"bla";

    • Moved by Shimin Huang Friday, May 4, 2012 6:39 AM C# (From:SharePoint 2010 - Using Visual Studio with SharePoint and other programming)
    Monday, April 23, 2012 10:07 AM

All replies

  • It causes the escape sequences not to be processed.

    E.g. two strings below are the same.

    string something = @"c:\first\second";
    string other = "c:\\first\\second";


    Please don't forget to mark the post as Helpful if you find my comment useful and as Answer if it solved your problem.


    Monday, April 23, 2012 10:18 AM
  • In addition to Ferovac answer I would say that the @ allow you to made a string value on multiple lines (very useful for some big contains)

    like

    string query = @" <Where>

    <Eq>

    bla bla bla </Eq>

    </Where> ";



    Best regards, Christopher.
    Blog | Mail


    Monday, April 23, 2012 10:40 AM