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

</div>

Method

# Left

<div class="warning">

<div class="title">

Warning

</div>

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

</div>

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

## Description

Returns the first *n* characters in a source `string</api/data_types/string>`.

## Usage

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

| Part           | Type                               | Description                                             |
|----------------|------------------------------------|---------------------------------------------------------|
| result         | `String</api/data_types/string>`   | The first *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 *source*. |

## Notes

The <span class="title-ref">Left</span> function returns characters from the source `string</api/data_types/string>` starting from the <span class="title-ref">Left</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 returns the first five characters in a `string</api/data_types/string>`.

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

## Compatibility

All project types on all supported operating systems.

## See also

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