Tools Links Login

Trim all those EXTRA spaces

VB forgot to add a Function strip out all those LEADING, TRAILING and EXTRA spaces in ONE Function.
I have seen many attempts at doing this but think mine does it in the least amount of code.
Note: = literal SPACE

Original Author: Brian Gillham

Inputs

String eg:Stripall

Returns

Stripall

Code

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 75 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.