Skip to content
Frederik Tobner edited this page Dec 27, 2022 · 6 revisions

A slice is a subset of an already existing array or string and is created by using the range operator.

The following code will create a new array with the size three, that contains the elements stored in the original array at index one, two and three:

var array = {1, 2, 3, 4, 5};
printf("{}\n", array[1 .. 3]);

The values stored in slice can be altered without affecting the original array, if the value is not a cellox object.

Clone this wiki locally