> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# left

> Returns a specified number of characters from the left side of a string.

This function returns a specified number of characters from the left side of a given string. The unit for length: utf8 character.
Note: This function is also named as [strleft](/documents/4.2/sql-reference/sql-functions/string-functions/strleft.md).

## Syntax

```SQL theme={null}
VARCHAR left(VARCHAR str,INT len)
```

## Examples

```SQL theme={null}
MySQL > select left("Hello starrocks",5);
+----------------------------+
| left('Hello starrocks', 5) |
+----------------------------+
| Hello                      |
+----------------------------+
```

## keyword

LEFT


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.