Search This Blog

Friday, March 29, 2013

String.Join Method C#

C# > String > Join

Join concatenates a specified separator string between each element of a specified String array.

Example


String[] str = { "red","green","blue","yellow" };
String sep = ",";
String result = String.Join(sep, str, 0, 4); // "red,green,blue,yellow"