<div class="meta" robots="noindex">

</div>

Method

# RTrim

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `String.TrimRight<string.trimright>` as a replacement.

</div>

## Description

Returns the `string</api/data_types/string>` data type passed with trailing (right side) whitespaces removed.

## Usage

*result*=**RTrim**(*SourceString*)

**OR**

*result*=*stringVariable*.**RTrim**

| Part           | Type                             | Description                                                                    |
|----------------|----------------------------------|--------------------------------------------------------------------------------|
| result         | `String</api/data_types/string>` | *SourceString* with trailing whitespaces removed.                              |
| SourceString   | `String</api/data_types/string>` | The source, a copy of which, to be returned with trailing whitespaces removed. |
| stringVariable | `String</api/data_types/string>` | Any variable of type `String</api/data_types/string>`.                         |

## Notes

Rtrim uses the list of unicode "whitespace" characters at <http://www.unicode.org/Public/UNIDATA/PropList.txt>.

## Sample code

This example removes the whitespaces from the right side of the string passed:

``` xojo
Var s As String
s = RTrim("  Hello World  ") ' Returns "  Hello World"
s = "  Hello World  "
s = s.RTrim //Returns "  Hello World"
```

## Compatibility

All project types on all supported operating systems.

## See also

`Asc</api/math/asc>`, `Chr</api/text/chr>`, `String.IndexOf<string.indexof>`, `String.Length<string.length>`, `String.Left<string.left>`, `String.TrimLeft<string.trimleft>`, `String.Middle<string.middle>`, `String.Trim<string.trim>` functions; `String</api/data_types/string>` data type.
