How to check if a list contain specific value in Groovy

1 Answer

0 votes
def lst = [5, 7, 2, 0, 9]
		
println(lst.contains(2))

println(lst.contains(3))




/*
run:

true
false

*/

 



answered Oct 3, 2020 by avibootz
edited Oct 4, 2020 by avibootz

Related questions

1 answer 389 views
1 answer 336 views
1 answer 326 views
1 answer 336 views
1 answer 348 views
1 answer 290 views
1 answer 453 views
...