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

# array:pad — Pad array

ARRAY:PAD pads an array to a given length.

If the length is positive then the array is padded on the right, if it is negative then on the left. If the absolute length is less than or equal to the actual length of the array then no padding takes place.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Variable name |
| var_result | var | (destructive on 'var') | Result variable name |
| length | int |  | Length |
| padding | string | (NULL) | Padding value |

### 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>
</array>

<array:pad var="names" length="3" padding="Larry Ellison"/>
<output>$names[1] and $names[2] are friends!</output>

<!-- Steve Jobs and Larry Ellison are friends! -->
```
