If I have a list
var myList = new List<string>();
and I add a couple of strings
myList.Add("Hello");
myList.Add("World");
myList.Add("!");
How do I print the entire list on one line? If I try Console.WriteLine(myList);
the console prints "System.Collections.Generic.List`1[System.String]" instead of "Hello World !". I've tried
myList.ForEach(Console.WriteLine);
but that prints "Hello", "World" and "!" on separate lines instead of on one line. How would I go about printing the list on one line?