View Problem

Remove the last element of a list

ExpandDiskEdit
groovy 1.0+
list = ['Apple', 'Banana', 'Carrot']
// to produce a new list
newlist = list[0,1]
// to modify original list
list.remove(2)

Submit a new solution for groovy
There are 16 other solutions in additional languages (cpp, erlang, fsharp, java ...)