Enum format: "G", "F", "D", "X" : Enum format « Data Types « C# / C Sharp






Enum format: "G", "F", "D", "X"

    


using System;

public class Example
{
    public static void Main()
    {
        DayOfWeek thisDay = DayOfWeek.Monday;
        string[] formatStrings = { "G", "F", "D", "X" };

        foreach (string formatString in formatStrings)
            Console.WriteLine(thisDay.ToString(formatString));
    }
}
/*

Monday
Monday
1
00000001


*/

   
    
    
    
  








Related examples in the same category

1.Format enum
2.Format Enum as string
3.Get a collection of flags from a flag value.