Rtrim-funktion [Runtime]

From LibreOffice Help
Jump to: navigation, search

Raderar blanksteg i slutet av ett stränguttryck.

Se även: Ltrim-funktion

Syntax:

RTrim (Text As String)

Returvärde:

String

Parametrar:

Text: Ett stränguttryck.

Felkoder

5 Felaktigt proceduranrop

Exempel:

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