---
schema_version: "1"
id: 797997f2b78789772688b4a7ec3499c03084421e94f5b063a690d36535bacbb1
title: ltrim()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-functions-string-ltrim.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-ltrim.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3ca5c80b01971a1399c1b61f5cf6b902417020aaa8b4e91335cda57d22c66b81
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# ltrim()

Removes the specified characters from the beginning of a string.

## Syntax

`ltrim`(_string_,_substr_)

## Usage

Removes every instance of each character in _substr_ from the beginning of _string_. This function is case-sensitive. To remove leading spaces, do not specify a value for _substr_.

## Example

This example shows that `ltrim` removes the specified characters from the beginning of a string. This function is case-sensitive.

```nolang
q = load "test";
q = foreach q generate 'Company' as 'Company', ltrim('Company',"abc") as 'ltrim abc',
    ltrim('Company',"cba") as 'ltrim cba', ltrim('Company',"ab") as 'ltrim ab',
    ltrim('Company',"bc") as 'ltrim bc';
```

![Diagram showing number of close opps, grouped by day of the week they were closed.](https://developer.salesforce.com/media/bi_dev_guide_saql/ltrim.png)
