SQL Server LTRIM function Example
Let’s look at some examples of LTRIM function in SQL Server.
Using LTRIM() function Example
In this example, we will demonstrate the basic use of the LTRIM function in SQL Server.
SELECT LTRIM(' w3wiki');
Output :
w3wiki
LTRIM() function with a variable Example
In this example, we will use the LTRIM function in SQL Server with a variable.
DECLARE @str VARCHAR(50)
SET @str = ' Have a nice time ahead!!'
SELECT LTRIM(@str);
Output :
Have a nice time ahead!!
Use of “trim_space” in LTRIM() function Example
In this example, we will remove specific characters from a string using the LTRIM function.
SELECT LTRIM (‘000325400’, ‘0’);
Output :
325400
LTRIM() Function in SQL Server
The LTRIM() function in SQL Server removes all the space characters found on the left-hand side of the string. It removes the leading spaces from a string,
Contact Us