# Text Helper

Join, replace, split, trim and change the case of text.

## Do things in Text Helper

Add a **Text Helper** step and choose an **Operation**. Choose the row to see the fields of each.

- [Transform Text](https://docs.gorunner.io/apps/text-helper#fields-f-transform): Concatenate · Replace (all) · Replace (first only) · Replace (Regex) · Regex Extract (matches) · Split · Uppercase · Lowercase · Title Case · Capitalize · Trim whitespace · Substring · Length · Contains? · Find (index of) · Reverse · Repeat · Pad · Slugify · Strip HTML · Default if empty · JSON → ASCII table

Later steps read a step’s output by its name: see [Use data from earlier steps](https://docs.gorunner.io/build/use-data-from-earlier-steps).

**What changed in version 2?**

New steps use version 2.0.0. A step made before keeps 1.0.0 and works as it always has. The step’s panel shows its version at the top right. On an older step it reads **v1.0.0 · 2.0.0 available**: press it to choose the version.

In 2.0.0: **Separator** reads `\n`, `\r` and `\t` as a new line, a return and a tab. **Strip HTML** uses the HTML app’s stripper, so script code is removed. Version 1.0.0 uses the separator as typed.

Not in your list? See [When an app isn’t here](https://docs.gorunner.io/apps/when-an-app-isnt-here#q-not-in-list).

## For developers

In the API, which calls apps pieces, Text Helper is `pieceId: "text"` with `actionId: "transform"`, set by `operation`. [Get an app](https://docs.gorunner.io/api/apps/get-app) returns every field.

It computes from its inputs only (`pure`). See [How versions and side effects work](https://docs.gorunner.io/apps#q-versions).

### Text Helper › Transform Text

Apply a text operation to an input string.

### Concatenate

- **Texts to join · Optional**: Values to concatenate in order.
- **Separator · Optional**: The text between the pieces, such as a comma or a semicolon. Type \n for a line break, \t for a tab, \r\n for a Windows line break (\\ for a backslash). Split with Separator left blank splits into single characters.

### Replace (all), Replace (first only) and Replace (Regex)

- **Text · Optional**: The input text.
- **Find · Optional**: The word or phrase to look for in the text, such as hello.
- **Replace with · Optional**: The new text to put in place of what was found, such as world.

### Regex Extract (matches), Contains? and Find (index of)

- **Text · Optional**: The input text.
- **Find · Optional**: The word or phrase to look for in the text, such as hello.

### Split

- **Text · Optional**: The input text.
- **Separator · Optional**: The text between the pieces, such as a comma or a semicolon. Type \n for a line break, \t for a tab, \r\n for a Windows line break (\\ for a backslash). Split with Separator left blank splits into single characters.

### Uppercase, Lowercase, Title Case, Capitalize, Trim whitespace, Length, Reverse and Strip HTML

- **Text · Optional**: The input text.

### Substring

- **Text · Optional**: The input text.
- **Start index · Optional**: Where to start copying the text from, counting from 0 for the first character, such as 0. Default: 0.
- **End index · Optional**: Leave empty for end of string.

### Repeat

- **Text · Optional**: The input text.
- **Count · Optional**: How many times to repeat the text, such as 3. Default: 2.

### Pad

- **Text · Optional**: The input text.
- **Target Length · Optional**: The total length the text should reach by adding extra characters, such as 10. Default: 10.
- **Pad Character · Optional**: The character used to fill the extra space, such as 0 or a space. Default:.
- **Pad Side · Optional**: Choose whether the extra characters are added before or after the text. Options: Left (start), Right (end). Default: Left (start).

### Slugify

- **Text · Optional**: The input text.
- **Lowercase · Optional**: Convert the slug to lowercase (on = my-slug). Turn off to keep the original case (My-Slug). On by default.

### Default if empty

- **Text · Optional**: The input text.
- **Default Value · Optional**: Returned when the input text is empty.

### JSON → ASCII table

- **Rows (JSON array of objects) · Optional**: Array of objects to render as an ASCII table.

Source: https://docs.gorunner.io/apps/text-helper
