I want to print an array
via Console.writeline
.
I'm lazy and want to do it in one line, avoiding iterating through all the array
.
Here is my code:
var costumers = new Costumers[10];
// Array initialization...
Console.WriteLine("Initial array: '{0}'",string.Join(Environment.NewLine,costumers.ToList()) );
Array.Sort(costumers);
Is it OK to use String.Join
for this purpose or it decreases performance dramatically?
Is there an elegant way to do it?
Thanks, Paul