LTrim Function

The LTrim() or Left Trim function removes all specified characters from the left-hand side of a string, it requires minimum of one (1) argument and maximum 2. Comparison is case sensitive If only one parameter is provided blank spaces are removed.

Syntax for LTrim() is LTrim( String , [ string to remove ] ) .

The [ string to remove ] will be removed from the left-hand side of string. If second parameter is omitted, the ltrim function will remove all leading spaces from string.

SELECT LTRIM('    SQLDatabase.Net    ') /* returns SQLDatabase.Net after removing empty spaces from left  */ ;
        
SELECT LTRIM('SQLDatabase.Net', 'SQL') /* returns Database.Net */ ;
SELECT LTRIM('SQLDatabase.Net', 'sql') /* returns SQLDatabase.Net due to case mismatch between SQL and sql */ ;
> SELECT LTRIM('SQLSQLSQLSQLDatabase.Net', 'SQL') /* returns Database.Net after trimming "SQL" */ ;