Retrieves an array of the names of the constants in a specified enumeration. - CSharp System

CSharp examples for System:Enum

Description

Retrieves an array of the names of the constants in a specified enumeration.

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from   ww  w.  j av a 2s.  c  om*/

public class Main{
        /// <summary>
        /// Retrieves an array of the names of the constants in a specified enumeration.
        /// </summary>
        /// <returns>A string array of the names of the constants in <typeparamref name="TEnum"/>.</returns>
        public static string[] GetNames()
        {
            return Enum.GetNames(_enumType);
        }
}

Related Tutorials