0
Which are valid c# veriable name?
4 Respostas
+ 4
C# like any programming languages is case sensitive language, been said that here are some arbitrary rules for valid variable name
1. A variable name must always start with an alphabet. (except one exception)
2. A variable name cannot start with number, a number can appear anywhere in variable name except at the starting.
3. no special character is allowed in a variable name except underscore (_) sign.
4. a variable name can however start with underscore.
5. a variable name should not contain white space.
so all variable names that follow above rules are valid variable name.
+ 1
Your first letter in a variable name must be small letter if you want to combine two words, e.g myName
+ 1
if it's start with a letter
0
must start with a letter or underscore