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

</div>

Method

# Right

<div class="warning">

<div class="title">

Warning

</div>

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

</div>

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

## Description

Returns the last n characters from the `string</api/data_types/string>` specified.

## Usage

``` xojo
result = sourceVariable.Right(count)
```

| Part           | Type                               | Description                                               |
|----------------|------------------------------------|-----------------------------------------------------------|
| result         | `String</api/data_types/string>`   | The rightmost *count* characters of *source*.             |
| sourceVariable | `String</api/data_types/string>`   | The *source* string from which to get the characters.     |
| count          | `Integer</api/data_types/integer>` | The number of characters you wish to get from the source. |

## Notes

The <span class="title-ref">Right</span> function returns characters from the source string starting from the <span class="title-ref">Right</span> side (as the name implies).

If you need to read bytes rather than characters, use the `MemoryBlock</api/language/memoryblock>` class.

## Sample code

This example uses the <span class="title-ref">Right</span> function to return the last 5 characters from a `String</api/data_types/string>`:

``` xojo
Var result As String
Var source As String = "Hello World"
result = source.Right(5) ' returns "World"
```

## Compatibility

All project types on all supported operating systems.

## See also

`String</api/data_types/string>` for a complete list of functions.
