# RTrim()

Removes spaces from the end of a string.

```
RTrim( string=string );
```

**Returns:** string

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| string | string | Yes | A string or a variable that contains one |  |

# 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 trailing spaces
  writeDump("-" & RTrim(foo) & "-");
```







# Categories

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

# See Also

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