Listing 10-24 extracted from chapter The .NET 2 type system from a C#2 point of view
Listing 10-23< > Listing 10-25
This listing can be compiled with the command line: csc.exe /target:exe Example_10_24.cs Errors: 0 Warnings: 0
class Program { enum Maker { Renault, Ford, Toyota } static void Main() { Maker maker = Maker.Renault; string s = System.Enum.Format( typeof( Maker ) , maker , "G" ); // Here, the string 's' is equal to "Renault". } }