groovy Array entfernen Sie die Klammern

  def colarray=[]
                    def num
                    def newRole = rolecol.split(',')
                    def len = newRole.size()
                    println "$newRole,$len"
                    for (num = 0; num < len; num++) {
                        def col = "col"
                        col="$col"+newRole[num]
                        colarray.add(col)

                    }
                    println colarray
                    sql.eachRow("select col01,$colarray from read_csv where col01=? and col${usercol}!=? ", [file.name,""])

Ich möchte col1..col11 in array speichern und von select-Anweisung aufrufen, aber das Problem ist, dass $ colarray die eckigen Klammern enthält (wie [col03, col04, col05, col06, col07, col08, col09, col10, col11, col12, col13, col14, col15, col16, col17, col18, col19, col20, col21, col22, col23, col24, col25, col26, col27, col28, col29, col30, col31, col32, col33]), also jetzt möchte ich um sie zu entfernen, kann mir jeder helfen ??? thx

Antworten auf die Frage(4)

Ihre Antwort auf die Frage