LTRIM Removes leading spaces from a string. : LTRIM « String Functions « SQL Server / T-SQL Tutorial






4>
5> DECLARE @STRING_WITH_SPACES VARCHAR(30)
6> DECLARE @STRING_WITHOUT_SPACES VARCHAR(30)
7> SET @STRING_WITH_SPACES = " www.java2s.com"
8>
9> SET @STRING_WITHOUT_SPACES = LTRIM(@STRING_WITH_SPACES)
10>
11> SELECT @STRING_WITH_SPACES
12> SELECT @STRING_WITHOUT_SPACES
13> GO

------------------------------
 www.java2s.com

(1 rows affected)

------------------------------
www.java2s.com

(1 rows affected)
1>








12.9.LTRIM
12.9.1.LTRIM Removes leading spaces from a string.
12.9.2.The LTRIM() and RTRIM() Functions
12.9.3.Removing Leading Blanks
12.9.4.select LTRIM(' SQL Server ')