VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Truncates repetitive characters in a word

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

Rate 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


Download this snippet    Add to My Saved Code

Truncates repetitive characters in a word Comments

No comments have been posted about Truncates repetitive characters in a word. Why not be the first to post a comment about Truncates repetitive characters in a word.

Post your comment

Subject:
Message:
0/1000 characters