0

Is their a way where the user could type Low to use the enum instead of typing 1?
I know how to do this with strings, but am having trouble trying to figure it out using enums.

public enum Volume : byte
{
    Low = 1,
    Medium,
    High
}

// shows different ways
// to work with enums
class Enumtricks
{
    static void Main(string[] args)
    {
        // instantiate type
        Enumtricks enumtricks = new Enumtricks();

        // demonstrates explicit cast
        // of int to Volume
        enumtricks.GetEnumFromUser();



        Console.ReadLine();
    }
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by aaronmk2
0

Thanks, I was looking under enum switch, should have been looking for enum parse

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.