# TRIM

### Description

TRIM removes whitespace (like "   ") from the beginning or end of a string.&#x20;

Optionally, you can also provide a second argument of the characters you would like to remove.&#x20;

If you only want to remove characters from the left, consider using [`TRIM_LEFT`](https://docs.atfinity.io/rule-language/operators/string-operators/trim_left).

### Example

```
TRIM('   I like Atfinity ')
```

This will remove the spaces before and after leaving only the text `'I like Atfinity'` without the spaces behind.

### Example with custom character

```
TRIM('__hello__', '_')
```

This will remove the underscores before and after leaving only the text `'hello'` without the spaces behind.
