Tuesday, March 25, 2014

GRAILS / GROOVY -- Merging / combining sublist into single list

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]