Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created November 17, 2017 12:00
Show Gist options
  • Select an option

  • Save jskeet/3f87a77b94d5c001b14e62ebea9cdfe8 to your computer and use it in GitHub Desktop.

Select an option

Save jskeet/3f87a77b94d5c001b14e62ebea9cdfe8 to your computer and use it in GitHub Desktop.
using System;
public enum Product
{
Work = 33,
Travel = 34
}
public class Test
{
static void Main()
{
bool success = Enum.TryParse("travel", true, out Product product);
Console.WriteLine(success);
Console.WriteLine(product);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment