View Problem

Remove the last element of a list

DiskEdit
ruby
list = ['Apple', 'Banana', 'Carrot']
list.delete_at(-1)
DiskEdit
ruby
list = ['Apple', 'Banana', 'Carrot']
list.pop
ExpandDiskEdit
cpp C++/CLI .NET 2.0
fruit->RemoveAt(fruit->Count - 1);
ExpandDiskEdit
fantom
list := ["Apple", "Banana", "Carrot"]
list.removeAt(-1)
ExpandDiskEdit
fantom
list := ["Apple", "Banana", "Carrot"]¨
list.pop

Submit a new solution for ruby, cpp, or fantom
There are 19 other solutions in additional languages (clojure, csharp, erlang, fsharp ...)