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 224 views
1 answer 224 views
1 answer 210 views
1 answer 217 views
1 answer 204 views
1 answer 167 views
1 answer 362 views
...