sublist
list begin end
Parameters:
| list |
List |
List that you want to subset |
| begin |
Integer |
The beginning index that you want to keep |
| end |
Integer |
The ending index that you want to keep |
Description:
Return a new list that is a subset of the original list. The new list will be end - begin + 1 elements long, and will contain the elements of list from and including begin up to end.
Examples:
sublist [1 2 3 4 5] 2 4 returns [2 3 4].
sublist [1 2 3 4 5] 0 0 returns [1].
sublist [1 2 3 4 5] 4 5 returns [4 5].
Related Commands:
list
sentence
to-list