View Problem

Remove an element from a list by index

Given the list [Apple, Banana, Carrot], remove the first element to produce the list [Banana, Carrot]
DiskEdit
ruby
['Apple', 'Banana', 'Carrot'].shift
ExpandDiskEdit
ruby
fruit.delete_at(0)
DiskEdit
csharp c# 2.0
class Solution1516
{
static void Main()
{
List<string> fruit = new List<string>() { "Apple", "Banana", "Carrot" };
fruit.RemoveAt(0);
}
}
ExpandDiskEdit
erlang
Result = tl(List),
ExpandDiskEdit
erlang
[_|Result] = List,
ExpandDiskEdit
erlang
N = 1, {Left, Right} = lists:split(N - 1, List), Result = Left ++ tl(Right),
ExpandDiskEdit
erlang
Result = drop(1, List),
ExpandDiskEdit
fantom
list := ["Apple", "Banana", "Carrot"]
list.removeAt(0)
ExpandDiskEdit
cpp C++/CLI .NET 2.0
fruit->RemoveAt(0);

Submit a new solution for ruby, csharp, erlang, fantom ...
There are 21 other solutions in additional languages (clojure, fsharp, go, groovy ...)