> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/strings-cut.md).

# Strings cut

The **Strings cut** step returns a snippet of an input string based on a range of character locations.

For example, you may need to parse the time `11:00` out of a file name such as `11:00 am update` by returning the substring starting at index `0` and ending before index `5`.

{% hint style="info" %}
If you specify locations outside the length of the input string, Strings cut returns an empty string.
{% endhint %}

### Step name

* **Step name**: Specify the unique name of the Strings cut step on the canvas. You can customize the name or leave it as the default.

### Fields to cut

Use the **Fields to cut** table to specify what to cut and where to cut it.

| Column               | Description                                                                                                                            |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **In stream field**  | Name of the field containing the string to cut. Select **Get fields** to populate the table from the incoming stream.                  |
| **Out stream field** | (Optional) A new output field containing the substring result. If you do not specify a value, the step replaces **In stream field**.   |
| **Cut from**         | Starting character location (zero-based). The first character has index `0`.                                                           |
| **Cut to**           | Character location after the ending point (zero-based, exclusive). For example, setting **Cut to** to `1` returns the first character. |

The maximum length of the resulting string is **Cut to** minus **Cut from**.

### Example

Given the string `example`, the character indexes are:

| Character | e | x | a | m | p | l | e |
| --------- | - | - | - | - | - | - | - |
| Index     | 0 | 1 | 2 | 3 | 4 | 5 | 6 |

To return the first letter `e`, set **Cut from** to `0` and **Cut to** to `1`.

To return `am`, set **Cut from** to `2` and **Cut to** to `4`.

### Metadata injection support

This step supports metadata injection. You can use it with [ETL metadata injection](https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/etl-metadata-injection.md) to pass metadata to your transformation at runtime.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/strings-cut.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
