What does the @ symbol before a variable name mean in c#?

Source: https://stackoverflow.com/questions/429529/what-does-the-symbol-before-a-variable-name-mean-in-c


The @ symbol allows you to use reserved word. For example:

int @class = 15;

The above works, when the below wouldn’t:

int class = 15;

Microsoft official documentation on this subject: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/verbatim

Leave a Comment