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 240 views
1 answer 240 views
1 answer 228 views
1 answer 232 views
1 answer 215 views
1 answer 174 views
1 answer 369 views
...