I\'m new to Grails/Groovy and am trying to find a node in a an xml file; I\'ve figured out how to iterate over all of them, but I want to exit the loop when the target node is f
Replace each loop with any or find closure.
def list = [1, 2, 3, 4, 5] list.any { element -> if (element == 2) return // continue println element if (element == 3) true // break }
Output
1 3