---
schema_version: "1"
id: 912341e767ef1e4f755a7c7414f2101a1ffdd948f3a681c9dc0066d4d2d6ece0
title: Trim()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/string/mc-ampscript-reference-string-trim.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-trim.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 627fb3921788159070ae1379b660a1c6aa4c990d0461a13820341778c7e91ea1
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Trim()

Removes white space from the beginning and end of a string.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).

## Syntax

```
Trim(sourceString)
```

The `Trim(sourceString)` function has one parameter:

- `sourceString` (string): Required. The string to remove whitespace from.

## Usage

To use the function, pass it a string to trim.

```
%%[
  Var @address, @addressClean
  Set @address = "       דרך השלום 5, תל אביב-יפו, ישראל      "
  Set @addressClean = Trim(@address)
]%%
```

The function returns the provided string with whitespace removed from the beginning and end: `דרך השלום 5, תל אביב-יפו, ישראל`
