Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created February 24, 2014 15:00
Show Gist options
  • Save csharpforevermore/9189868 to your computer and use it in GitHub Desktop.
Save csharpforevermore/9189868 to your computer and use it in GitHub Desktop.
Parse a string to an enum
public static T ParseEnum<T>( string value )
{
return (T) Enum.Parse( typeof( T ), value, true );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment