Using flatten we can easily merge sublists into a single list.
def sublists = [['a','b','c'],['d','e','f']] println sublists.flatten() // prints [a, b, c, d, e, f]
No comments:
Post a Comment