Cut: Difference between revisions

From The K Language Wiki
Content added Content deleted
m (Lowercase title)
("Better category ordering, add redirects to categories, fix pseudo-adverb categories")
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{lowercase title}}
{{primitive|x_y|in=K9}}
{{primitive|x_y|in=K9}}


Line 22: Line 21:
""
""
,"e")</pre>
,"e")</pre>

[[Category:Verbs]]
[[Category:Operator verbs]]
[[Category:Primitives]]

Latest revision as of 06:14, 9 July 2022

Cut
x_y
Supported in K9

The cut primitive partitions the array y before the indices given in array x.

The portion of the array before the first index is ignored.

Indices must be given in ascending order.

 0 4_"feedface"
("feed";"face")

 3 5_"adfdsfsdfa"
("ds"
 "fsdfa")

Repeating indices add empty cuts in that location:

 0 2 4 4 4_"abcde"
("ab"
 "cd"
 ""
 ""
 ,"e")