It seems that Groovy does not support break and continue from within a closure. What is the best way to simulate this?
break
continue
revs.eachLin
Use return to continue and any closure to break.
Example
File content:
1 2 ---------------------------- 3 4 5
Groovy code:
new FileReader('myfile.txt').any { line -> if (line =~ /-+/) return // continue println line if (line == "3") true // break }
Output:
1 2 3