title: Best way to convert list to comma separated string in java
body: <p>I have <code>Set&lt;String&gt; result</code> &amp; would like to convert it to comma separated string. My approach would be as shown below, but looking for other opinion as well.</p>
  
  <pre><code>List&lt;String&gt; slist = new ArrayList&lt;String&gt; (result);
  StringBuilder rString = new StringBuilder();
  
  Separator sep = new Separator(", ");
  //String sep = ", ";
  for (String each : slist) {
      rString.append(sep).append(each);
  }
  
  return rString;
  </code></pre>