Get the App
SLTechnology News&Howtos  ›  Servers  › 

Naming rules for Csharp variables

Shulou Source: shulou.com Published: 2022-06-03 05:55:46 09月21日 Update

The first character of a variable must be: letter, underscore, Chinese character, or @

The first character can be followed by letters, numbers, underscores, or Chinese characters

Variable name cannot be the same as keyword

Eg: variable names cannot take these keywords such as int, double, if, using, namespace, and so on.

Because these guys already have a special meaning, if you really want to take the keyword as the variable name, you can use @ int, @ double, and so on.

C# variable names are strictly case-sensitive

Tags: Variables keywords keywords underscores letters characters Chinese characters special meaning size guy numbers numbers rules Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno Linux Xiaomi Docker