What’s the @ Symbol in front of a string in C# – Programming, Pseudocode Example, C# Programming Example
C# C# Console

What’s the @ Symbol in front of a string in C#

In C# the at (@) character is used to denote literals that explicitly do not adhere to the relevant rules in the language spec.

Specifically, it can be used for variable names that clash with reserved keywords (e.g. you can’t use params but you can use @params instead, same with out/ref/any other keyword in the language specification).

Additionally it can be used for unescaped string literals; this is particularly relevant with path constants, ,e.g. instead of

alternatively you can do this:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.