I frequently find myself writing code like this:
List<int> list = new List<int> { 1, 3, 5 }; foreach (int i in list) { Console.Write('{0}\t', i.ToString()); } Console.WriteLine();
Better would be something like this:
List<int> list = new List<int> { 1, 3, 5 }; Console.WriteLine('{0}\t', list);
I suspect there’s some clever way of doing this, but I don’t see it. Does anybody have a better solution than the first block?
Do this:
EDIT: To others that have responded – he wants them all on the same line, with tabs between them. 🙂