tinmegali
5/30/2018 - 2:52 PM

Output a Collection/List/Array

public static string FlatCollection<T>(IEnumerable<T> col)
{
  // getting item values and converting then to strings
  List<string> items = new List<string>();
  foreach(var item in col)
    items.Add( item.ToString() );
  // returning collection value as a flat string
  return string.Join("\n\n", items);
}