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

# substr — Substring

SUBSTR returns part of a value, isolated by an offset and a length.

If the offset is negative it will start that many bytes or characters from the end of the value. If the length is omitted, every byte or character from the offset until the end of the value will be returned. If the length is negative then it will stop that many bytes or characters from the end of the value.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name |
| offset | int |  | Offset |
| length | int | (end of value) | Length |
| type | type | chars | Measurement type |

#### Possible values
Possible values for `type`:
- chars — By characters
- bytes — By bytes


### Children
- (none)

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

### Result
- binding: var; type: string

### Examples

```xml
<output>
	<substr offset="6" length="2">Name: iXML</substr>
</output>

<!-- iX -->
```
