Skip to content

Instantly share code, notes, and snippets.

@caglartoklu
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caglartoklu/2078797e88c124bc91b6 to your computer and use it in GitHub Desktop.
Save caglartoklu/2078797e88c124bc91b6 to your computer and use it in GitHub Desktop.
C# List Concatenation #cs #list
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
List<string> listed = new List<string>() {"1", "2", "3", "4"};
Console.WriteLine(">" + string.Join("-", listed));
// >1-2-3-4
listed = new List<string>();
Console.WriteLine(">" + string.Join("-", listed));
// >
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment