什么是一个变量名前的@符号在C#是什么意思?

什么是一个变量名前的@符号在C#是什么意思?

问题描述:

可能重复:结果
  What's在C#中的变量名的@符号的使用/含义?

据我了解,@符号可以将字符串改变编译器如何解析字符串前使用。但是,当一个变量名是@符号pfixed $ P $这是什么意思?

I understand that the @ symbol can be used before a string literal to change how the compiler parses the string. But what does it mean when a variable name is prefixed with the @ symbol?

@符号允许您使用保留字。例如:

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

int @class = 15;

以上的作品,当下面的不会:

The above works, when the below wouldn't:

int class = 15;