I think there's a built-in Groovy function that will do this for you. ```join``` maybe?