Groovy web console

subscribe to the feed Subscribe
to this
site

Krcarray

Published 2 months ago by Krc
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def arrayOne = ['a', 'b'];
def arrayTwo = ['c', '', 'd']

(arrayOne + arrayTwo).join(',')

println arrayOne.indexOf("b")

arrayOne.eachWithIndex { name, index, indexPlusOne = index + 1 ->     println "Name $name has position $indexPlusOne" }