LTRIM(Transact-SQL)
선행 공백을 제거한 문자 식을 반환합니다.
구문
LTRIM ( character_expression )
인수
반환 형식
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)