LTRIM: removes leading spaces from a string : LTRIM « String Functions « SQL Server / T-SQL






LTRIM: removes leading spaces from a string


1> -- LTRIM: removes leading spaces from a string.
2>
3> DECLARE @STRING_WITH_SPACES VARCHAR(30)
4> DECLARE @STRING_WITHOUT_SPACES VARCHAR(30)
5> SET @STRING_WITH_SPACES = " www.java2s.com"
6>
7> SET @STRING_WITHOUT_SPACES = LTRIM(@STRING_WITH_SPACES)
8>
9> SELECT @STRING_WITH_SPACES
10> SELECT @STRING_WITHOUT_SPACES
11> GO

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

(1 rows affected)

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

(1 rows affected)
1>
           
       








Related examples in the same category

1.LTRIM: trim the white space to the left