Last active
May 11, 2023 04:33
-
-
Save BinToss/33ad39ac18bac593f9e4408aa6084dfe to your computer and use it in GitHub Desktop.
C# - How is a combination of flag values converted to string?
This file contains 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
#!meta | |
{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"name":"csharp"}]}} | |
#!csharp | |
/** Q: How is a combination of flag values converted to string? | |
A: 3 is "one, two" | |
*/ | |
[Flags] | |
enum Parsely{ | |
none = 0, | |
one = 1, | |
two = 2, | |
} | |
Parsely parsely = (Parsely)3; | |
parsely.ToString().Display(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment