# Trim()

Removes leading and trailing spaces from a string.

```
Trim( string=string );
```

**Returns:** string

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| string | string | Yes | the string to trim |  |

# Examples

```cfml
  // create variable with a string of text that has leading and trailing spaces
  foo = " Hello World!  ";
  // output variable
  writeDump("-" & foo & "-");
  // output variable without leading and trailing spaces
  writeDump("-" & Trim(foo) & "-");
```







# Categories

[Strings](../../categories/string.md)

# See Also

[LTrim()](ltrim.md), [RTrim()](rtrim.md), [TrimWhitespace()](trimwhitespace.md), [string.trim()](../objects/string/trim.md)