you can use
return (Enum) Activator.CreateInstance(enumType);
This will give you the default value for the type - this is what you want.
EDIT: I expected you to recognize the type at compile time, in which case generics are a good approach. Although this does not seem to be the case, I will leave the rest of this answer in case it is useful to someone else.
Alternatively, you can use Unconstrained Melody , which already contains something like this function in a more efficient and safe form :)
MyEnum value; if (Enums.TryParseDescription<MyEnum>(description, out value)) {
value will be set to "0" if the parsing operation is not successful.
It is currently case sensitive, but you can easily create a case-insensitive version. (Or let me know, and I can do it.)
source share