---
title: "array:slice — Slice array items"
description: "iXML command array:slice: Slice array items."
canonical_url: "https://www.zeyos.com/ixml/ref/array-slice"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/array-slice.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# array:slice — Slice array items

ARRAY:SLICE slices part of an array, isolated by an offset and a length.

If the offset is negative it will start that many items from the end of the array. If the length is omitted, every item from the offset until the end of the array will be returned. If the length is negative then it will stop that many items from the end of the array.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Variable name |
| var_result | var | (destructive on 'var') | Result variable name |
| offset | int |  | Offset |
| length | int | (end of array) | Length |

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var|var_result; type: array; predicate: no-result-propagation

### Examples

```xml
<array var="names">
	<item>Bill Gates</item>
	<item>Steve Jobs</item>
	<item>Larry Ellison</item>
</array>

<array:slice var="names" offset="1" length="2"/>

<output>
	<array:join var="names" delimiter=", "/>
</output>

<!-- Steve Jobs, Larry Ellison -->
```
