title: Convert Array to string in Java/Groovy
body: <p>I have a list like this:</p>
  <pre><code>List tripIds = new ArrayList()
  
  def sql = Sql.newInstance(&quot;jdbc:mysql://localhost:3306/steer&quot;, &quot;root&quot;, &quot;&quot;, &quot;com.mysql.jdbc.Driver&quot;)
          
  sql.eachRow(&quot;SELECT trip.id from trip JOIN department WHERE organization_id = trip.client_id AND department.id = 1&quot;) {
    println &quot;Gromit likes ${it.id}&quot;
    tripIds &lt;&lt; it.id
  } 
  </code></pre>
  <p>On printing tripids gives me value:</p>
  <pre><code>  [1,2,3,4,5,6,]
  </code></pre>
  <p>I want to convert this list to simple string like:</p>
  <pre><code> 1,2,3,4,5,6
  </code></pre>
  <p>How can I do this?</p>