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

ご支援をお願いします!