title: How create a comma-separated string from items in a list
body: <p>If I print values in a list, it will be like below:</p>
  
  <pre><code>main(List&lt;String&gt; arguments) {
    List cities = ['NY', 'LA', 'Tokyo'];
    String s = '';
    for(var city in cities)
      s += '$city, ';
    print(s);//NY, LA, Tokyo, 
  }
  </code></pre>
  
  <p>But I want to separate each element in a list by comma(<strong>without for the last element</strong>).</p>
  
  <p>In Java we can do it like below:</p>
  
  <pre><code>List&lt;String&gt; cities = Arrays.asList("NY", "LA", "Tokyo");
  System.out.println(cities.stream().collect(joining(", ")));//NY, LA, Tokyo
  </code></pre>
  
  <p>In Dart I <strong>did</strong> it like below:</p>
  
  <pre><code>main(List&lt;String&gt; arguments) {
    List cities = ['NY', 'LA', 'Tokyo'];
    print(formatString(cities));//NY, LA, Tokyo
  }
  
  String formatString(List x) {
    String formatted ='';
     for(var i in x) {
       formatted += '$i, ';
     }
    return formatted.replaceRange(formatted.length -2, formatted.length, '');
  }
  </code></pre>
  
  <p><strong>Is there any simpler method in Dart?</strong></p>