C# IEnumerable print out

I am having problems with an array where I for example want to printout the odd numbers in the list.

int[] numbers = new int[]{ 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
Console.WriteLine(numbers.Where(n => n % 2 == 1).ToArray());

The ToString method does not seem to work? I do not want to loop through the elements. What can I do?

12
задан Eric Lippert 22 February 2011 в 16:21
поделиться