Answers for ".net core convert string to enum"

C#
1

c# convert string to enum value

using System;

Enum.tryParse("input", out EnumName myEnum);
Posted by: Guest on May-25-2021
1

C# .net core convert string to enum

var foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);
if (Enum.IsDefined(typeof(YourEnum), foo))
{
    return foo;
}
Posted by: Guest on April-27-2020

Code answers related to ".net core convert string to enum"

C# Answers by Framework

Browse Popular Code Answers by Language