.NET: Convert a String to an Enum

4/14/2015 4:22:17 PM

Converts a string to a enum.

string stringValue = "Enabled";

StatusEnums enumValue = (StatusEnums )Enum.Parse(typeof(StatusEnums), stringValue, true);