Coffeehouse Post

Single Post Permalink

View Thread: Oh My God an MVP! [MSDN Forums related]
  • User profile image
    Lazycoder2

    I posted this reply in the MSDN forum, but I'll post it here for posterity too.

    Look at this code snippet and the resulting IL.

            static void Main(string[] args) {
                String foo = String.Empty;
                string foo2 = string.Empty;
            }


    .method private hidebysig static void  Main(string[] args) cil managed
    {
      .entrypoint
      // Code size       13 (0xd)
      .maxstack  8
      IL_0000:  ldsfld     string [mscorlib]System.String::Empty
      IL_0005:  pop
      IL_0006:  ldsfld     string [mscorlib]System.String::Empty
      IL_000b:  pop
      IL_000c:  ret
    } // end of method Program::Main