# String Operations

With the **String Operations** step, you can perform the following operations on an incoming PDI field:

* Trim (remove leading and/or trailing spaces).
* Convert to upper or lowercase.
* Pad (add leading or trailing extra characters).
* Convert to initial capitalization.
* Ignore escape characters.
* Remove or return only numeric digits.
* Remove special characters.

### Step name

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

### Fields to process

Use the **Fields to process** table to specify which operations you want to apply to your input strings.

| Column                       | Description                                                                                                                                                                                          |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **In stream field**          | Name of the field containing the string to process. Select **Get fields** to populate the table from the incoming stream.                                                                            |
| **Out stream field**         | (Optional) A new output field containing the results of the string operations. If you do not specify a value, the step replaces **In stream field**.                                                 |
| **Trim type**                | Remove extra spaces from the left side, right side, or both. The default is none.                                                                                                                    |
| **Lower/Upper**              | Convert characters to lowercase or uppercase. The default is none.                                                                                                                                   |
| **Padding**                  | Add extra characters to the left side or right side. The default is none.                                                                                                                            |
| **Pad char**                 | The character added to the field for padding.                                                                                                                                                        |
| **Pad Length**               | The number of padding characters to add.                                                                                                                                                             |
| **InitCap**                  | Capitalize the initial character. The default is N.                                                                                                                                                  |
| **Escape**                   | <p>Use, ignore (escape), or process (unescape) the following formats if present in the field:</p><ul><li>XML</li><li>HTML</li><li>CDATA</li><li>SQL</li></ul><p>The default is None.</p>             |
| **Digits**                   | Return only or remove numeric digits. The default is none.                                                                                                                                           |
| **Remove Special character** | <p>Remove special characters:</p><ul><li>Carriage return (CR)</li><li>Line feed (LF)</li><li>Carriage return and line feed</li><li>Horizontal tab</li><li>Space</li></ul><p>The default is none.</p> |

### Metadata injection support

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


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/string-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
