Check out example codes for "string to enum c#". It will help you in understanding the concepts better.

Code Example 1

var foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);
if (Enum.IsDefined(typeof(YourEnum), foo))
{
    return foo;
}

Code Example 2

StatusEnum MyStatus = (StatusEnum) Enum.Parse(typeof(StatusEnum), "Active", true);

Code Example 3

Enum.TryParse("Active", out StatusEnum myStatus);

Code Example 4

//This example will parse a string to a Keys value
Keys key = (Keys)Enum.Parse(typeof(Keys), "Space");
//The key value will now be Keys.Space

Learn ReactJs, React Native from akashmittal.com