Is there a way to use an integer index to return the appropriate value from an enum? For example, if there is the enum Color {Red, Green, Blue) is there a function that for the value 0 will return Red, 1 will return Green, and 2 will return Blue?
Share
The Enum.GetName method: http://msdn.microsoft.com/en-us/library/system.enum.getname.aspx
Using your example,
prints “Green”