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 385 views
1 answer 334 views
1 answer 322 views
1 answer 334 views
1 answer 340 views
1 answer 285 views
1 answer 452 views
...