title: How can I trim all elements in a list?
body: <p>I'm trying the following</p>
  
  <pre><code>string tl = " aaa, bbb, ccc, dddd             eeeee";
  
  var tags = new List&lt;string&gt;();
  tags.AddRange(tl.Split(','));
  tags.ForEach(x =&gt; x = x.Trim().TrimStart().TrimEnd());
  
  var result = String.Join(",", tags.ToArray());
  </code></pre>
  
  <p>But it doesn't work, the tags always come back as " aaa", " bbb".</p>
  
  <p>How can I trim all elements in a list?</p>