Skip to main content

select

Function select 

Source
pub fn select(index: any, values: Repeatable<any>) -> Repeatable<any>
Expand description

If index is a number, returns all arguments after argument number index; a negative number indexes from the end (โˆ’1 is the last argument). Otherwise, index must be the string "#", and select returns the total number of extra arguments it received.

ยงExamples

print(select("#", "a", "b", "c"))    --> 3
print(select(2, "a", "b", "c"))      --> b   c
print(select(-1, "a", "b", "c"))     --> c