# byte_array.sub · Rell standard library · Chromia Docs (concept)

> pure function sub(start: integer ): byte_array Returns a sub-array of this byte array starting from the specified index (inclusive). Parameters start — the

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/byte_array/sub/

FUNCTION

# byte\_array.sub

```signature
pure function sub(start: integer): byte_array
```

Returns a sub-array of this byte array starting from the specified index (inclusive).

**Parameters**

* **start** — the start index of the sub-array

**Throws**

* `exception` — if the `start` index is out of range

Since 0.6.0

---

```signature
pure function sub(start: integer, end: integer): byte_array
```

Returns a sub-array of this byte array from the specified start index (inclusive)
to the specified end index (exclusive).

**Parameters**

* **start** — the start index of the sub-array
* **end** — the end index of the sub-array

**Throws**

* `exception` — when: - the `start` or `end` indexes are out of range - the `start` index is greater than the `end` index

Since 0.6.0

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/byte_array/sub.html)Generated API reference, mirrored from the live docs
