📜  C# .net core 将字符串转换为枚举 - C# 代码示例
📅  最后修改于: 2022-03-11 14:49:10.299000             🧑  作者: Mango
代码示例1
var foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);
if (Enum.IsDefined(typeof(YourEnum), foo))
{
return foo;
}