---
title: ES|QL LTRIM function
description: 
url: https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/string-functions/ltrim
products:
  - Elasticsearch
---

# ES|QL LTRIM function
## Syntax

![Embedded](https://www.elastic.co/docs/reference/query-languages/esql/images/generated/x-pack-esql/functions/ltrim.svg)


## Parameters

<definitions>
  <definition term="string">
    String expression. If `null`, the function returns `null`.
  </definition>
</definitions>


## Description

Removes leading whitespaces from a string.

## Supported types


| string  | result  |
|---------|---------|
| keyword | keyword |
| text    | keyword |


## Example

```esql
ROW message = "   some text  ",  color = " red "
| EVAL message = LTRIM(message)
| EVAL color = LTRIM(color)
| EVAL message = CONCAT("'", message, "'")
| EVAL color = CONCAT("'", color, "'")
```


| message:keyword | color:keyword |
|-----------------|---------------|
| 'some text  '   | 'red '        |