Answers for "check if enum contains value c#"

C#
1

c# enum check in string value

if (System.Enum.IsDefined(MyEnumType, MyValue))
{
    // Do something
}
Posted by: Guest on September-02-2020
0

check an enum containa an int or not in C#

Enum.IsDefined(typeof(MyEnum), 1)? "1 is valid": "not valid";
Posted by: Guest on August-17-2021

Code answers related to "check if enum contains value c#"

C# Answers by Framework

Browse Popular Code Answers by Language