Sunday, January 27, 2013

Tip-Convert array to Comma delimited string

I was needed to convert an string array into the comma delimited string and the old way to do that is too with for loop. But I was sure that there should be some ready made function that will do this very easily.

After doing some research I have found string.Join. With the help of this we can easily an array into the comma delimited string.

String.join have two arguments one is separator and other one is either array or enumerable.

Following is a code for that.
namespace ConsoleApplication3
    class Program
        static void Main() {
            string[] name = {"Jalpesh", "Vishal", "Tushar", "Gaurang"};
            string commnaDelmietedName = string.Join(",", name);

Let’s run that example and here is the output as expected.


That’s it. Hope you like it. Stay tuned for more..


  1. Can u explain article Jelph how to handle login on g icon click here on coment area ?

  2. thanks I think you have already got that to login with google plus


Your feedback is very important to me. Please provide your feedback via putting comments.

Search This Blog
About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews