I want to add a line to every line in a list of lines. I wanted to do something like this
def a = 'a ' def b = 'b ' [a,b].each { it += 'yo' } assertEquals a, 'a yo' assertEquals b, 'b yo'
But obviously it won't work.
You can do
(a,b) = [a,b].collect { "$it yo" }