> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/generic/string-operations/trim.md).

# Trim

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to remove extra spaces at the beginning and end of the input text. The updated text is stored in a dynamic variable.

## **Syntax**

**Input Value**: `<input string>`

| Argument                                | Description                                                  |
| --------------------------------------- | ------------------------------------------------------------ |
| <p>\<input string></p><p>(Required)</p> | Provide the string from which the spaces need to be removed. |

**Output Value**: `<Dynamic Variable>;<Dynamic Variable>(Optional)`

| Argument                                    | Description                                                                 |
| ------------------------------------------- | --------------------------------------------------------------------------- |
| <p>\<Dynamic Variable></p><p>(Required)</p> | This dynamic variable stores the trimmed string.                            |
| <p>\<Dynamic Variable></p><p>(Optional)</p> | This dynamic variable stores the operation status as **True** or **False**. |

### **Example**: Trimming Extra Spaces from a String

In this example, we explain how to remove unwanted spaces from the beginning and end of a string.

* **Action**: Trim
* **Input Value**: Alice
  * This specifies the string ( **Alice** ) that contains leading and trailing spaces to be removed.
* **Output Value**: {Trimmed String}
  * The trimmed result (Alice) is stored in this **{Trimmed String}** dynamic variable for further use.
  * If the second output variable is defined, it stores the action status with the following possible values:
    * **True**: If the trimming is successful.
    * **False**: If the trimming fails due to invalid input or configuration.
* **Logical Explanation**: The **Trim** action fetches the value from the **Input Value** column ( **Alice** ) and removes the extra spaces from both ends. The resulting string (Alice) is then stored in the **{Trimmed String}** variable.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FtRD2V5ZNERIZBWx1i3Wo%2Fimage.png?alt=media&amp;token=51cb5aab-30e0-4f68-8185-62aa3a29f300" alt=""><figcaption></figcaption></figure>

#### **Knowledge Bites:**

Here are some examples of different string scenarios:

{% hint style="info" %}
**Note**: In the below **Input Value** examples, the strings contain spaces. Double quotation marks are used only to clearly highlight these spaces. Do not include the double quotation marks when entering the actual Input Value.
{% endhint %}

| String               | Input Value          | Result           |
| -------------------- | -------------------- | ---------------- |
| Text Strings         | " Automation "       | Automation       |
| Numeric Strings      | " 123456 "           | 123456           |
| Special Character    | " <abc@domain.com> " | <abc@domain.com> |
| Alphanumeric strings | " ID2025 "           | ID2025           |


---

# 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.avoautomation.com/avo-assure/actions/generic/string-operations/trim.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.
