borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2012 Andrea Tincani
:: Trim ALL thos extra spaces in a String

Author  

Brian Gillham

Language  

VB5, VB6

Operating Systems  

Windows 95, 98 and NT
Module
Public Function TrimALL(ByVal TextIN As String) As String
    TrimALL = Trim(TextIN)
    While InStr(TrimALL, String(2, " ")) > 0
        TrimALL = Replace(TrimALL, String(2, " "), " ")
    Wend
End Function
Usage
Private Sub Command1_Click()
    MsgBox TrimALL("Hello     !    !    ! This function     removes all    extra spaces      from     strings")
End Sub
:: Navigation

Home

Miscellaneous Tips

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 25-02-2006 Re: please tell me why my customer form gets hung up by kabba
icon 14-02-2006 String Function needed by niyati
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2012 Andrea Tincaniborder