[C#] Getting the value of an enum through a string
1 min readOct 28, 2017
enum Pets
{
Dog= 1,
Cat = 2
}
// Passing the description you want the value
string description= "dog";
// The value will be 1 as expected.
int value = (int)Enum.Parse(typeof(Pets), description);