Joining Array of Strings In C#
// File: Program.cs
// Author: Leo Custodio
// Date: Jun-15-11
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace StringJoin
{
/// <summary>
/// Joining an array of String.
/// </summary>
class Program
{
static void Main(string[] args)
{
String[] arrIds = { "0", "2", "4", "6", "8" };
String strJoined = String.Join(", ", arrIds);
Console.Write(strJoined);
}
}
}
Output:
0, 2, 4, 6, 8
Last modified by Leo Custodio on June-15-11.