.NET 4.0 New Feature - String.Concat
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { String[] stringCollection = { “123”, “456”, “789” }; int[] intCollection = { 123, 456, 789 }; Object[] objCollection = { 123, “456”, 789.0f }; float[] floatCollection = { 123.0f, 456.0f, 789.0f };
ShowValue<String>("stringCollection", stringCollection);
ShowValue<int>("intCollection", intCollection);
ShowValue<Object>("objCollection", objCollection);
ShowValue<float>("floatCollection", floatCollection);
}
static void ShowValue<T>(string title, IEnumerable<T> values)
{
Console.WriteLine("{0}: {1}", title, string.Concat<T>(values));
}
}
}