John,
Can someone give me an example where an enumeration format string of g would
return a different result to that of f?
enum E
{
A = 0x1,
B = 0x2,
}
E e3 = (E)3;
Console.WriteLine( e3.ToString( "g" ) );
Console.WriteLine( e3.ToString( "f" ) );
"g" will print 3, "f" will print A, B. The f specifier gives you flags
formatting, even if the Flags attribute hasn't been applied to the
enum type.
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.