# trim

## Description

Trim a string of text.

## Input / Parameter

| Name | Description              | Input Type | Default | Options | Required |
| ---- | ------------------------ | ---------- | ------- | ------- | -------- |
| text | The value to be trimmed. | Text       | -       | -       | Yes      |

## Output

| Description                | Output Type |
| -------------------------- | ----------- |
| Returns the trimmed value. | String/Text |

## Example

In this example, we will trim a text using trim function.

### Steps

1. Drag a `button` component into the canvas and open the `Action` tab. Select the `press` event of the button.
2. Add `Log.write` function and add a subflow on it's value, then put `Text.trim` inside it and fill text param with \[ `Tes t ing` ].

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-bcc70a77858db7461ec94241ed64186167d16de7%2Ftrim-step-1.png?alt=media)

### Result

1. The console on preview will show us the trimmed text value \[`Tes t ing`] instead of \[ `Tes t ing` ].

   * Note that the spaces before and after the text is removed (trimmed).

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-a39f2a0dbf3252c9c270af71e7bb0651d34ee196%2Ftrim-result-1.png?alt=media)

## Links

### Related Information
