Posted By

thebugslayer on 06/18/07


Tagged


Versions (?)

slicing, range and step


 / Published in: Groovy
 

  1. list = [1,2,3,4,5,6,7,8,9,10]
  2. list[1..8]
  3. list[(1..8).step(2)]
  4. list[[1, 3, 5, 7]]

Report this snippet  

You need to login to post a comment.