when to use @ in c#?

前端 未结 5 1143
春和景丽
春和景丽 2020-12-06 04:44

I use @ symbol with local path only, but when do I use @ exactly?

5条回答
  •  感情败类
    2020-12-06 05:15

    AFAIK, You can use @ at any place where you don't want to let the default meaning of the thing persist. For example, @class will make class an identifier. @bool will make bool an identifier instead of a keyword.

    You know the usage of @ before strings. It is used to indicate that take all the text of the string literally and don't treat any character in the string specially.

    Edit: An yes, another thing to this is that @Keyword is compiled into a Keyword in IL.

    See this Link for more details.

提交回复
热议问题