You can count the number of constants defined in a C# enumeration with the static Enum.GetNames method. This returns an Array containing the names of the constants defined in the enumeration. You can then check the Array’s Length property.
Jul 23
Jul 19
C# includes a number of pre-defined “built-in” data types. Each built-in data type is represented by a class in the System namespace that inherits from the base System.Object class. For example, an integer is represented by the System.Int32 class, and a string is represented by the System.String class.
C# defines an alias keyword for each built-in type. The alias keyword and its corresponding C# type are interchangeable. For example, you can define a string with the “string” keyword or “System.String” type: