C# @keyword as escape of keyword

it is very common to see that C# code use @keyword such as @this to escape ‘this’ as keyword to use it like a local variable.

1
2
3
4
5
6
7
8
9
class @class
{
   public static void @static(bool @bool) {
      if (@bool)
         System.Console.WriteLine("true");
      else
         System.Console.WriteLine("false");
   }   
}
This entry was posted in C#. Bookmark the permalink.