Create CSV From a Simple Collection.

Here is a handy snippet I normally use to create a CSV string from a simple collection of strings:


   1: public string ToCsv(IEnumerable<string> collection){
   2:     return string.Join(",", collection.ToArray());
   3: }
Advertisement
Previous Post
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.