本文件已封存並已停止維護。
LTRIM (Transact-SQL)
SQL Server 2005
傳回移除開頭空白的字元運算式。
相容性層級可能會影響傳回值。如需有關相容性層級的詳細資訊,請參閱<sp_dbcmptlevel (Transact-SQL)>。
下列範例會利用 LTRIM 來移除字元變數中的開頭空白。
DECLARE @string_to_trim varchar(60) SET @string_to_trim = ' Five spaces are at the beginning of this string.' SELECT 'Here is the string without the leading spaces: ' + LTRIM(@string_to_trim) GO
以下為結果集:
------------------------------------------------------------------------ Here is the string without the leading spaces: Five spaces are at the beginning of this string. (1 row(s) affected)
顯示:

