Groovy web console

subscribe to the feed Subscribe
to this
site

Krc array

Published 2 months ago by Krc
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
String myline = " jklkjsadf.  Asdfklj ["

def arrayOne = ["r8.6", "r8.7", "r8.8", "r8.9"]


println arrayOne.indexOf("r8.7")

arrayOne.reverse().eachWithIndex { name, index, indexPlusOne = index + 1 ->   

println "Name $name has position $indexPlusOne" }