Skip to content

Instantly share code, notes, and snippets.

@BinToss
Last active May 11, 2023 04:33
Show Gist options
  • Save BinToss/33ad39ac18bac593f9e4408aa6084dfe to your computer and use it in GitHub Desktop.
Save BinToss/33ad39ac18bac593f9e4408aa6084dfe to your computer and use it in GitHub Desktop.
C# - How is a combination of flag values converted to string?
#!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