remove first item from given collection
Parameters
drop collection :string :literal :pathliteral :block
Attributes
times | :integer | remove multiple items |
Returns
Examples
copy
drop "xhello" ; => "hello"
drop drop "xhello" ; => "ello"
copy
str: "some text"
drop.times:5 str ; => text
drop.times: neg 5 str ; => some
copy
arr: @1..10
drop.times:3 'arr
arr ; => [4 5 6 7 8 9 10]
copy
drop [1 2 3] ; => [2 3]
copy
drop.times:1 [1 2 3] ; => [2 3]
drop.times:2 [1 2 3] ; => [3]
drop.times:3 [1 2 3] ; => []
drop.times:4 [1 2 3] ; => []
copy
drop.times: neg 1 [1 2 3] ; => [1 2]
drop.times: neg 2 [1 2 3] ; => [1]
Related