Sunday, April 19, 2020

How to Use Keywords as Variable Names @csharp

Use Keywords as Variable Names in #csharp var @string= string.Empty;
@string = "We can use keyword string as variable name, cool huh! trick compiler, we know better.."
In case, if you want to use Keywords as variable names (identifiers), then you need to include @ as a prefix for your variable names. For example, @switch is a valid identifier but the switch is not because it's a keyword and having a special meaning for the compiler.

No comments :