语法
LTRIM ( character_expression ) |
参数
备注兼容级别可能影响返回值。有关兼容级别的详细信息,请参阅 sp_dbcmptlevel (Transact-SQL)。
返回类型varchar 或 nvarchar
示例以下示例使用 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
|
|