Returns the nth item in list. The first item in a list has an index of 1. If i is 0 or negative, the first item is returned as well. If i is larger than the length of list, the last item is returned.
Syntax
nth ( i As Any; _
list As Any ) As Any
Argument
Type
Description
i
Any
The index of the item to return.
list
Any
The list
Example 1
Intent >nth(3, {"a", "b", "c", "d", "e"})
--> "c"
Example 2
Intent >nth(1, {"a", "b", "c", "d", "e"})
--> "c"
Example 3
Intent >nth(0, {"a", "b", "c", "d", "e"})
--> "a"
Example 4
Intent >nth(-1, {"a", "b", "c", "d", "e"})
--> "a"