by vipin (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 12th September 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Truncates repetitive characters in a word
' Copy and paste the following code into the click event of the command button
Private Sub Command1_Click()
For i = 1 To Len(Trim(Text1))
For j = 1 To Len(Trim(Text1))
If Not j = i Then
If Mid(Text1, j, 1) = Mid(Text1, i, 1) Then
Text1 = Trim(Mid(Text1, 1, j - 1)) & Trim(Mid(Text1, j + 1, Len(Trim(Text1))))
End If
End If
Next j
Next i
End Sub