How to remove the first element from a list in Groovy

1 Answer

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

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

 



answered Oct 5, 2020 by avibootz

Related questions

1 answer 159 views
1 answer 169 views
1 answer 343 views
1 answer 105 views
1 answer 140 views
...