by ratnala (2 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 24th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Removes multiple duplicate spaces within strings
Const Space = " "
Dim inPos As Long
stInput = Trim$(stInput)
inPos = InStr(1, stInput, Space, vbBinaryCompare)
Do While inPos > 0
stInput = Left$(stInput, inPos) & LTrim$(Right$(stInput, Len(stInput) - inPos))
inPos = InStr(inPos + 1, stInput, Space, vbBinaryCompare)
Loop
SquishMultiSpaces = stInput
End Function