Trim Function

αž™αž€β€‹αž…αŸαž‰β€‹αž–αžΈβ€‹αž€αž“αŸ’αžŸαŸ„αž˜β€‹αžαŸ’αžŸαŸ‚β€‹αž’αž€αŸ’αžŸαžšβ€‹αž“αžΌαžœβ€‹αžšαžΆαž›αŸ‹β€‹αžŠαž€β€‹αžƒαŸ’αž›αžΆβ€‹αžŠαŸ‚αž›β€‹αž“αŸ…β€‹αž˜αž»αž αž“αž·αž„β€‹αž“αŸ…β€‹αž€αŸ’αžšαŸ„αž™Β αŸ”

Syntax:


Trim( Text As String )

Return value:

αžαŸ’αžŸαŸ‚β€‹αž’αž€αŸ’αžŸαžš

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!