LTrim Function

문자열 식의 시작 부분에 있는 모든 선행 공백을 제거합니다.

Syntax:

LTrim (Text As String)

Return value:

String

Parameters:

Text: 임의의 문자열 식입니다.

이 함수를 사용하여 문자열 식의 시작 부분에 있는 공백을 제거합니다.

Error codes:

5 잘못된 프로시저 호출입니다.

Example:

Sub ExampleSpaces
Dim sText2 As String,sText As String,sOut As String
    sText2 = " <*Las Vegas*> "
    sOut = "'"+sText2 +"'"+ Chr(13)
    sText = Ltrim(sText2) ' sText = "<*Las Vegas*> "
    sOut = sOut + "'"+sText +"'" + Chr(13)
    sText = Rtrim(sText2) ' sText = " <*Las Vegas*>"
    sOut = sOut +"'"+ sText +"'" + Chr(13)
    sText = Trim(sText2) ' sText = "<*Las Vegas*>"
    sOut = sOut +"'"+ sText +"'"
    MsgBox sOut
End Sub

Please support us!