Created
November 17, 2017 12:00
-
-
Save jskeet/3f87a77b94d5c001b14e62ebea9cdfe8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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