Trim Function

āĻ¸ā§āĻŸā§āĻ°āĻŋāĻ‚ āĻāĻ•ā§āĻ¸āĻĒā§āĻ°ā§‡āĻļāĻ¨ā§‡āĻ° āĻ¸āĻŦāĻšā§‡ā§Ÿā§‡ āĻ¸āĻžāĻŽāĻ¨ā§‡āĻ° āĻāĻŦāĻ‚ āĻļā§‡āĻˇā§‡āĻ° āĻĢāĻžāĻāĻ•āĻž āĻ¸ā§āĻĨāĻžāĻ¨ āĻ…āĻĒāĻ¸āĻžāĻ°āĻŖ āĻ•āĻ°āĻž āĻšā§ŸāĨ¤

Syntax:


Trim( Text As String )

Return value:

String

Parameters:

āĻŸā§‡āĻ•ā§āĻ¸āĻŸ: āĻ¯ā§‡ āĻ•ā§‹āĻ¨ āĻ¸ā§āĻŸā§āĻ°āĻŋāĻ‚ āĻāĻ•ā§āĻ¸āĻĒā§āĻ°ā§‡āĻļāĻ¨āĨ¤

Error codes:

5 Invalid procedure call

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!