String separating in list

.net, asp.net, asp.net-mvc, c#, c#-4.0

Solution

string gh = String.Join(",", listitems); //

Problem

I have a list called `listitems` which contains information on items. I want to separate each list item by a comma and put it in a string called `gh` But when I use the following I get the output as : `",a,b"` which is incorrect but I want the output as `"a,b"`. How can I modify the code ? ``` foreach(var a in listitems) { gh = gh +"," + a; } ```

Original source

Related problems