parse enum to string code example
Example 1: string to enum c#
Enum.TryParse("Active", out StatusEnum myStatus);
Example 2: enum value to string
class Program.
static void Main(string[] args)
{
Enum wkday = Weekday.Friday;
Console.WriteLine("Enum string is '{0}'", wkday.ToString());
Console.ReadKey();
}
Example 3: java enum to string
public enum MyEnum{
SOMETHING,SOMETHING_ELSE
}
MyEnum enumObject=MyEnum.SOMETHING;
System.out.println(enumObject.toString());
System.out.println(enumObject.name());