Groovy 跳出each循环

 
each例子:
def a = [1, 2, 3, 4]
a.each {
    if (it == 2)
        return true // 满足条件本轮循环结束
 println it
}

猜你喜欢

转载自www.cnblogs.com/baxianhua/p/12102349.html
今日推荐