Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove double letters

Status
Not open for further replies.

FROGGY01

Technical User
Aug 9, 2002
6
FR

how can i remove a double letter in a word

like follow me = folow me

thanks

i usually use a function search and replace but i think they are an another solution
 
I would use a function to do this.
perhaps your function can be improved, may we see it, then perhaps we can help better.
 
so if you want

;)



Public Function s_RemplacerChaine(ByVal vs_Valeur As String, rs_Avant As String, rs_Apres As String) As String
Dim ls_Result As String
Dim li_Pos As Integer

ls_Result = ""

While Len(vs_Valeur) > 0
li_Pos = InStr(vs_Valeur, rs_Avant)
If li_Pos > 0 Then
ls_Result = ls_Result + Left$(vs_Valeur, li_Pos - 1) + rs_Apres
vs_Valeur = Mid$(vs_Valeur, li_Pos + Len(rs_Avant))
Else
ls_Result = ls_Result + vs_Valeur
vs_Valeur = ""
End If
Wend

s_RemplacerChaine = ls_Result
End Function
 
Just to make sure you want to remove any double letter ?
It looks like you are sending the letter to be removed in the above function.
Perhaps if you gave me a line example to work with, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top