Print the contents of an array (code is one line, for use in Immediate window of visual studio)

.net, c#, visual-studio

Solution

myArray.ToList().ForEach(Console.WriteLine);

Honestly though, I don't think that'll work in the immediate window. It is a nice trick to print it all in one line, but I think for the immediate window, all you need is this:

? myArray

Problem

Can you write a convenient line of code that prints the contents of an array? I will use this in the Immediate Window of Visual Studio 2008, so really it has to work in that window. I may have left out some requirements, but that's pretty much what I'm trying to do.

Original source