Numbers
int a;
Declares an integer with a name of ‘a’. It must have a value.
int? b;
Introduced with C# 8.0
Declares an integer that can be null. This can be done with objects as well.
Strings
Checking for blanks
1 | if (string.IsNullOrEmpty(code)) |
Array of Strings
1 | String[] weekDays = new string[3] {"Sun", "Mon", "Tue", "Wed"}; |
References
- https://stackoverflow.com/questions/7872633/most-advisable-way-of-checking-empty-strings-in-c-sharp - discussion of variable checking
- https://www.geeksforgeeks.org/c-sharp-arrays-of-strings/ - Array of Strings
Return to C Sharp [[home]] page