Trim Function

āĻ¸ā§āĻŸā§āϰāĻŋāĻ‚ āĻāĻ•ā§āϏāĻĒā§āϰ⧇āĻļāύ⧇āϰ āϏāĻŦāĻšā§‡ā§Ÿā§‡ āϏāĻžāĻŽāύ⧇āϰ āĻāĻŦāĻ‚ āĻļ⧇āώ⧇āϰ āĻĢāĻžāρāĻ•āĻž āĻ¸ā§āĻĨāĻžāύ āĻ…āĻĒāϏāĻžāϰāĻŖ āĻ•āϰāĻž āĻšā§ŸāĨ¤

āϏāĻŋāύāĻŸā§āϝāĻžāĻ•ā§āϏ:

Trim( Text As String )

āĻĒā§āϰāĻĻāĻžāύ āĻŽāĻžāύ:

āĻ¸ā§āĻŸā§āϰāĻŋāĻ‚

āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāϟāĻžāϰ:

āĻŸā§‡āĻ•ā§āϏāϟ: āϝ⧇ āϕ⧋āύ āĻ¸ā§āĻŸā§āϰāĻŋāĻ‚ āĻāĻ•ā§āϏāĻĒā§āϰ⧇āĻļāύāĨ¤

Error codes:

5 Invalid procedure call

āωāĻĻāĻžāĻšāϰāĻŖ:

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