Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 30th, 2012  |  syntax: C#  |  size: 0.20 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. enum Foo
  2. {
  3.     Word,
  4.     [Description("Two Words")]
  5.     TwoWords,
  6. }
  7.  
  8. Foo bar = Foo.TwoWords;
  9. bar.ToDescription() // returns "Two Words" (and is the same as ToString() for anything without a tag)