 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Enum.GetNames in C#
It gets an array of the names of constants in an enumeration. The following is the syntax −
Enum.GetNames(Type)
Here, Type is an enumeration type.
The following is an example −
Example
using System;
class Demo {
   enum Vehicle {
      Car,
      Motorbike,
      Truck,
   };
   static void Main() {
      // display the enum
      foreach ( string res in Enum.GetNames ( typeof (Vehicle)))
      Console.WriteLine (res);
   }
}
Output
Car Motorbike Truck
Advertisements
                    