# String operations

## ![](/files/y6wY3xocqy2kOnvcuGvB) String operations

### Description <a href="#description" id="description"></a>

The String Operations transform can perform the following string operations on an incoming Hop 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.

| Hop Engine | <sup>✓</sup> |
| ---------- | ------------ |
| Spark      | ?            |
| Flink      | ?            |
| Dataflow   | ?            |

### Options

| Option                   | Description                                                      |
| ------------------------ | ---------------------------------------------------------------- |
| Transform name           | Name of the transform.                                           |
| In stream field          | Designate the field to transform.                                |
| Out stream field         | Designate the name of the field to be created.                   |
| Trim type                | Designate the trim type: none, left, right, or both.             |
| Lower/Upper              | Designate upper or lowercase.                                    |
| Padding                  | Designate left or right padding.                                 |
| Pad char                 | Designate the padding character.                                 |
| Pad Length               | Designate how long the padding will be.                          |
| InitCap                  | Transform to initial capitalization.                             |
| Escape                   | Define to Escape or Unescape XML, HTML, use CDATA or Escape SQL. |
| Digits                   | Designate whether to return remove, or do nothing to digits.     |
| Remove Special character | Designate a special character to remove.                         |

### Metadata Injection Support

All fields of this transform support metadata injection. You can use this transform with ETL Metadata Injection to pass metadata to your pipeline at runtime.

Values for Metadata Injection

| Field                    | Values                                                                                                                  |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| In stream fields         | list of source fields                                                                                                   |
| Out stream fields        | list of target fields                                                                                                   |
| Trim Type                | <p>0 = none<br>1 = left<br>2 = right<br>3 = both</p>                                                                    |
| Lower/Upper              | <p>0 = none<br>1 = lower<br>2 = upper</p>                                                                               |
| Padding                  | <p>0 = none<br>1 = left<br>2= right</p>                                                                                 |
| Pad Char                 | Character used for padding                                                                                              |
| Pad Length               | Lenght to pad                                                                                                           |
| InitCap                  | <p>0 = no<br>1 = yes</p>                                                                                                |
| Escape                   | <p>0 = none<br>1 = escapexml<br>2 = cdata<br>3 = unescapexml<br>4 = escapesql<br>5 = escapehtml<br>6 = unescapehtml</p> |
| Digits                   | <p>0 = none<br>1 = digits\_only<br>2 = remove\_digits</p>                                                               |
| Remove Special character | <p>0 = none<br>1 = cr<br>2 = lf<br>3 = crlf<br>4 = tab<br>5 = espace</p>                                                |


---

# 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.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/stringoperations.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.
