title: Write list/array on a single line
body: <p>I'm trying to output my lists and arrays in the middle of the sentence all in one line with commas separating each element.
  For example, dblList which contains 22.3, 44.5, 88.1 I need the output to look like this, "For the list (22.3, 44.5, 88.1), the average of its elements is: average."</p>
  
  <p>I'm sure it's really easy to do but I can't figure it out.</p>
  
  <p>Any help?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  
  namespace Averages
  {
      class Program
      {
          static void Main(string[] args)
          {
              List&lt;int&gt; integerList1 = new List&lt;int&gt; { 3 };
              List&lt;int&gt; integerList2 = new List&lt;int&gt; { 12, 15 };
              List&lt;double&gt; dblList = new List&lt;double&gt; { 22.3, 44.5, 88.1 };
              int[] myArr = { 3, 4, 5, 6, 7, 8 };
              CalculateAverage(integerList1, integerList2, dblList, myArr);
          }
  
          private static void CalculateAverage(List&lt;int&gt; intlist1, List&lt;int&gt; intlist2, List&lt;double&gt; dblist, int[] myArr)
          {
              Console.WriteLine($"For the list ({intlist1}), the average of its elements is: {intlist1.Average():F}");
              Console.WriteLine($"For the list ({intlist2}), the average of its elements is: {intlist2.Average():F}");
              Console.WriteLine($"For the list ({dblist}), the average of its elements is: {dblist.Average():F}");
              Console.WriteLine($"For the array [{myArr}], the average of its elements is: {myArr.Average():F}");
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/bYhjH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bYhjH.png" alt=""></a></p>