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 256 views
1 answer 200 views
2 answers 231 views
1 answer 276 views
1 answer 278 views
2 answers 300 views
...