Drop: Difference between revisions

From The K Language Wiki
Content added Content deleted
("Better category ordering, add redirects to categories, fix pseudo-adverb categories")
(add k3 note)
 
Line 4: Line 4:


positive <code>a</code> removes elements from the start, and negative <code>a</code> removes from the end, similar to [[take]].
positive <code>a</code> removes elements from the start, and negative <code>a</code> removes from the end, similar to [[take]].

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


<pre>
<pre>

Latest revision as of 09:26, 28 April 2023

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"