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
According to the Groovy Quick Start, using collect will collect the values returned from the closure.
collect
Here's a little example using the Groovy Shell:
groovy:000> ["a ", " b"].collect { it.trim() } ===> [a, b]