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

# strleft

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

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

## Syntax

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

## Examples

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

## keyword

STRLEFT


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