title: Comma separated using string.Join with LINQ
body: <p>I used string.Join in lambda expression to form comma seperated values</p>
  
  <p>I achieved it using the following code:</p>
  
  <pre><code>    var viewData = queue.Select(items =&gt; new companyQueueWithSegInfo()
  {
   segmentName = string.Join(",", items.Select(i =&gt; i.seginfo.Trim()));
  
                                    }).AsQueryable()
  
  }
  </code></pre>
  
  <p>The output for this will be :</p>
  
  <pre><code>AB ,CD
  </code></pre>
  
  <p>But I need output as</p>
  
  <pre><code>AB, CD
  </code></pre>
  
  <p>I tried like this:</p>
  
  <pre><code>string.Join(" ,",items.Select(i =&gt; i.segminfo)).Replace(",", ", ").Replace(" ,","")
  </code></pre>
  
  <p>Can anyone help me with this?
   but it didn't work.</p>