Removes duplicate spaces within strings.
Removes duplicate spaces within strings.
Rate Removes duplicate spaces within strings.
(1(1 Vote))
Const TWO_SPACES As String = " "
Dim intPos As Integer
Dim strTemp As String
intPos = InStr(1, strText, TWO_SPACES, vbBinaryCompare)
Do While intPos > 0
strTemp = LTrim$(Mid$(strText, intPos + 1))
strText = Left$(strText, intPos) & strTemp
intPos = InStr(1, strText, TWO_SPACES, vbBinaryCompare)
Loop
SquishSpaces = strText
End Function
Removes duplicate spaces within strings. Comments
No comments yet — be the first to post one!
Post a Comment