LTRIM()
LTRIM returns a character string after truncating leading characters.
Signature
LTRIM ( character_expression )Parameters
- character_expression — An expression of character or binary data. *character_expression* can be a constant, variable, or column. *character_expression* must be of a data type, except text, ntext, and image, that is implicitly convertible to varchar. Otherwise, use CAST to explicitly convert *character_expression*.
- characters — A literal, variable, or function call of any non-LOB character type (nvarchar, varchar, nchar, or char) containing characters that should be removed. nvarchar(max) and varchar(max) types aren't allowed.
Examples
SELECT '[' + LTRIM(' keyboard') + ']' AS trimmed;trimmed
-------------
[keyboard]SELECT LTRIM(' Five spaces are at the beginning of this string.');Five spaces are at the beginning of this string.SELECT LTRIM('123abc.' , '123.');abc.Run against SQL Server 16.0.4265.3 on 2026-09-13. This is the output we got, not the documentation’s.
Available on
- SQL Server 2017 and later
- Azure SQL Database
- Azure SQL Managed Instance
- Azure Synapse Analytics
- Analytics Platform System (PDW)
- Microsoft Fabric warehouse
- Fabric SQL database
Signature and description adapted from the Microsoft SQL documentation, used under the CC BY 4.0. SQL Server and Azure are trademarks of the Microsoft group of companies. This page is not affiliated with Microsoft.