Answers for "groovy get first element with condition"

0

groovy get first element with condition

class Example {
   static void main(String[] args) {
      def lst = [1,2,3,4];
      def value;
		
      value = lst.findAll {element -> element > 2}
      println(value);
   } 
}
Posted by: Guest on March-31-2021

Browse Popular Code Answers by Language