Groovy web console

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

array

Published 3 months 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("index $i : ${array[i]}; " )
     print ("${array[i]} , ")

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

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