# LTrim - script and chart function

LTrim() returns the input string trimmed of any leading spaces.

Syntax:

LTrim(text)

Return data type: string

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/LTrim.htm)

#### Example: Chart expressions

| Example | Result |
| --- | --- |
| `LTrim( ' abc' )` | Returns 'abc' |
| `LTrim( 'abc ' )` | Returns 'abc ' |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/LTrim.htm)

#### Example: Load script

```
Set verbatim=1; 
T1:

Load *,
len(LtrimString) as LtrimStringLength;      
Load *,
ltrim(String) as LtrimString;
Load *,
len(String) as StringLength;               
Load * Inline [
String
'   abc    '
' def  ']; 
				
```

Information noteThe "Set verbatim=1" statement is included in the example to ensure that the spaces are not automatically trimmed before the demonstration of the ltrim function. See [Verbatim](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemVariables/Verbatim.htm) for more information.

Result

| String | StringLength | LtrimStringLength |
| --- | --- | --- |
| def | 6 | 5 |
| abc | 10 | 7 |

## Learn more

* [RTrim - script and chart function](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/RTrim.htm)