Format Enum as string : Enum format « Data Types « C# / C Sharp






Format Enum as string

    

using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;


public static class EnumUtility
{
    public static string GetEnumStrig(Enum e)
    {
        return string.Format("{0:X}h ({0})", e);
    }


}   
    

   
    
    
    
  








Related examples in the same category

1.Enum format: "G", "F", "D", "X"
2.Format enum
3.Get a collection of flags from a flag value.