Hey, i try to trim each string item of an list in groovy
list.each() { it = it.trim(); }
But this only works within the closure, in the list th
If you really had to modify the list in place, you could use list.eachWithIndex { item, idx -> list[idx] = item.trim() }.
collect() is way better.