Answers for "cast string to enum c"

C#
1

c# convert string to enum value

using System;

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

How can I cast string to enum?

YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);
Posted by: Guest on July-01-2021

C# Answers by Framework

Browse Popular Code Answers by Language