Groovy web console

subscribe to the feed Subscribe
to this
site
array (via #groovywebconsole)
tweet this snippet Tweet
this
script

array

Published 1 month ago by test
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
int index = 3

List array = [5,8,-7,10,55,0,1]

int n = array.size()

for(int i = index; i < n; i++) {
     print ("${array[i]}, ")

    if(i+1 == array.size()) {
       i = -1;
       n = index
    }
}

//output = 10,55,0,1,5,8,-7