Converting from a string to an enum option
If you need to convert a string to an enum option, you can convert it using the Enum.Parse() method:
Day weekday = (Day) Enum.Parse(typeof(Day), "Wednesday", true);
If you need to convert a string to an enum option, you can convert it using the Enum.Parse() method:
Day weekday = (Day) Enum.Parse(typeof(Day), "Wednesday", true);
Comments