drop

From The K Language Wiki
Revision as of 09:26, 28 April 2023 by 43.254.111.18 (talk) (add k3 note)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Drop
a_y

The drop primitive removes elements from the start or the end of an array.

positive a removes elements from the start, and negative a removes from the end, similar to take.

In K3, as system names begin with an underscore, a space is required after _ to avoid ambiguity.

 1_1 2 3
2 3

 -2_"abcde"
"abc"