LTRIM(Transact-SQL)

선행 공백을 제거한 문자 식을 반환합니다.

항목 링크 아이콘 Transact-SQL 구문 표기 규칙

구문

LTRIM ( character_expression )

인수

  • character_expression
    문자 또는 이진 데이터의 입니다. character_expression은 상수, 변수, 또는 열일 수 있습니다. character_expression은 text, ntext 및 image이서는 안 되며 varchar로 암시적 변환이 가능한 데이터 형식이어야 합니다. 그렇지 않은 경우 CAST를 사용하여 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)

참고 항목

참조

데이터 형식(Transact-SQL)

문자열 함수(Transact-SQL)