How do I convert an Array to a Comma Delimited String

How do I convert an Array to a Comma Delimited String

This how do I shows how to convert an array to a comma delimited string.

String.Join method comes handy, when we need to concatenate an array into a string of seperators.

The folloing code snippet shows how to convert an array to a comma seperated string.

String[] array= {"once", "upon", "a", "time"};
String seperator   = ", ";
String result = String.Join(seperator, array);

From:
http://www.c-sharpcorner.com/UploadFile/mahesh/ArrayToCommaDelimitedString10272005130153PM/ArrayToCommaDelimitedString.aspx?ArticleID=66b0d5c4-6424-45c8-96ca-6b98ed6ca165

posted @ 2005-11-29 15:31  jhtchina  阅读(378)  评论(0编辑  收藏  举报