---
title: "Trim Text Step"
url: "https://docs.robotiq.ai/en/article/trim-text-step"
language: "en"
last_updated: "2025-12-24T14:39:06.246Z"
---

# Trim Text Step

The Trim Text step gets rid of extra spaces at the beginning or end of a text variable. This helps clean up your data before you use it for other things.

## How to Use the Trim Text Step

Use this step to remove spaces from the start or end of a text variable.

### Step 1: Add the Trim Text Step

1.  Drag and drop the **Trim Text** step into your process.
2.  (Optional) Give the step a custom name in the **Step name** field.

### Step 2: Configure Input Parameters

1.  **Source text variable** (Required): Pick an existing text variable that has the text you want to trim.
2.  **Trim type** (Required): Choose where to remove the spaces:
    -   **Beginning**: Removes spaces from the start of the text.
    -   **End**: Removes spaces from the end of the text.
    -   **Both**: Removes spaces from both the start and end of the text.

### Step 3: Define Output Parameter

1.  **Destination trimmed string variable** (Required): Type in the name of a new or existing text variable. The trimmed text will go here.

**Example:**

If your `Source text variable` is " Hello World " and you pick `Trim type` as **Both**, the `Destination trimmed string variable` will be "Hello World".

## Parameters Explained

**Step name** (Optional)

-   A custom name for the process step.
-   Example: "Clean User Input"
-   Use this to make your process easier to understand.

**Source text variable** (Required)

-   The name of an existing text variable.
-   This variable holds the text you want to change.
-   Example: `myInputText`

**Trim type** (Required)

-   Says which part of the text to trim.
-   Options: `Beginning`, `End`, `Both`
-   Choose `Both` to remove all spaces from the start and end.

**Destination trimmed string variable** (Required)

-   The name of the variable where the trimmed text will be saved.
-   You can use an existing variable or make a new one.
-   Example: `cleanedText`

## Related Articles

-   [Define Variable Step](https://docs.robotiq.ai/en/article/define-variable-step): Learn how to create new variables.
-   [Set Variable Value Step](https://docs.robotiq.ai/en/article/set-variable-value-step): Understand how to change the value of an existing variable.

## Need Help?

Can't find what you're looking for? Join the [Robotiq Community](https://community.robotiq.ai/home/) to get help from other users and the Robotiq team.

![](https://cdn-assets.productfruits.com/c4e278c9-c965-488b-aed7-6d9b799a241b)
