Home
C# Code- Do you know String should be @-quoted instead of using escape character for "\\"?
  v1.0 Posted at 1/05/2018 8:21 AM by Tiago Araujo

The @ symbol specifies that escape characters and line breaks should be ignored when the string is created.

As per:  Strings 

​string p2 = "\\My Documents\\My Files\\";

Figure: Bad example - Using "\\"

string p2 = @"\My Documents\My Files\";

Figure: Good example - Using @​​

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments:

    Note: Social Media login for Yotpo is not working in IE or Safari, please use Chrome. We are waiting for Yotpo to fix it.