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

# ES|QL LTRIM function
## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/3016/reference/query-languages/esql/images/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 '        |