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
You could also use the spread operator:
def list = [" foo", "bar ", " groovy "] list = list*.trim() assert "foo" == list[0] assert "bar" == list[1] assert "groovy" == list[2]