Monday, June 14, 2010

Convert an string Array to a Comma Delimited String by using C#.NET

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= {"a", "b", "c", "d"};
String seperator = ",";
String result = String.Join(seperator, array);

1 comment: