How to remove the first N elements from a list in Groovy

1 Answer

0 votes
def lst = ["Groovy", "Java", "C++", "C", "Python", "C#"] 
 
lst = lst.drop(3)
 
println lst

 
    
    
/*
run:
    
[C, Python, C#]
    
*/

 



answered Oct 5, 2020 by avibootz

Related questions

1 answer 265 views
1 answer 218 views
2 answers 239 views
1 answer 285 views
1 answer 298 views
2 answers 315 views
...