Removes multiple duplicate spaces within strings
Removes multiple duplicate spaces within strings
Rate Removes multiple duplicate spaces within strings
(1(1 Vote))
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
Removes multiple duplicate spaces within strings Comments
No comments yet — be the first to post one!
Post a Comment