Return to Snippet

Revision: 60090
at October 20, 2012 04:49 by denakitan


Initial Code
public enum StudioGhibliDirectors
{
    HayaoMiyazaki,
    IsaoTakahata,
    TomomiMochizuki,
    YoshifumiKondo,
    HiroyukiMorita,
    GoroMiyazaki,
    HiromasaYonebayashi
}

public class EnumIteration
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Studio Ghibli directors:");

        foreach (StudioGhibliDirectors director in Enum.GetValues(typeof(StudioGhibliDirectors)))
        {
            Console.WriteLine(director.ToString());                
        }
    }
}

Initial URL

                                

Initial Description
Examples of use of Enum type, like how to iterate its items.

Initial Title
.NET - C# - Enum - Basics

Initial Tags
Net, c#

Initial Language
C#