This function requires you to log in. Please enter your login details

View Problem

Fetch an element of a list by index

Given the list [One, Two, Three, Four, Five], fetch the third element ('Three')
ExpandDiskEdit
fsharp
let result = List.nth ["One"; "Two"; "Three"; "Four"; "Five"] 2

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