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.
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 :
Post a Comment