> ## Documentation Index
> Fetch the complete documentation index at: https://learn.workflow.dog/llms.txt
> Use this file to discover all available pages before exploring further.

# Slice Text

> Extract part of a string by start and end index.

The **Slice Text** action returns the portion of a string between two indexes.
Indexes are zero-based, and the character at **End** is not included.

## Inputs

| Input     | Type   | Required | Description                                                        |
| --------- | ------ | -------- | ------------------------------------------------------------------ |
| **Text**  | String | Yes      | The text to extract from.                                          |
| **Start** | Number | No       | The first included index. Defaults to `0`.                         |
| **End**   | Number | No       | The first excluded index. When omitted, the slice runs to the end. |

## Outputs

| Output    | Type   | Description                    |
| --------- | ------ | ------------------------------ |
| **Slice** | String | The extracted portion of text. |

## Index behavior

* Positive indexes count from the beginning, starting at `0`.
* Negative indexes count backward from the end; `-1` refers to the final
  character.
* An index outside the string is clamped to its valid bounds.
* If the resolved end comes before the resolved start, the result is empty.

For `workflow`, a start of `0` and end of `4` returns `work`. A start of `-4`
with no end returns `flow`.
