Comments on: How do you convert a string into an enum? https://bryanavery.co.uk/how-do-you-convert-a-string-into-an-enum/?utm_source=rss&utm_medium=rss&utm_campaign=how-do-you-convert-a-string-into-an-enum this and that Sun, 09 Nov 2008 17:45:01 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: bryan https://bryanavery.co.uk/how-do-you-convert-a-string-into-an-enum/#comment-61 Sun, 09 Nov 2008 17:45:01 +0000 /post/2008/09/25/How-do-you-convert-a-string-into-an-enum2/#comment-61 Also worth noting and capturing is how to go through the collection of an Enum

foreach ( string s in Enum.GetNames(typeof(MyEnum)) )
{
whatever.add(s);
}

More on:

msdn2.microsoft.com/en-us/library/system.enum(VS.71)/

]]>