How can I cast string to enum

247

How can I cast string to enum? -

YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);

Comments

Submit
0 Comments