|
 |
 |
 |
| |
 Chercher et tout remplacer
Public Function ChercheEtRemplaceTout(Phrase As String, Cherche As String, Remplace As String) As String
Dim PositionCourante As Long
PositionCourante = 1
Do
PositionCourante = InStr(PositionCourante, Phrase, Cherche)
Phrase = Left$(Phrase, PositionCourante - 1) & Remplace & Right$(Phrase, Len(Phrase) - PositionCourante - Len(Cherche) + 1)
Loop Until InStr(Phrase, Cherche) = 0
ChercheEtRemplaceTout = Phrase
End Function
phrase= ChercheEtRemplaceTout("bonjour","j", "b")
donc phrase sera : bonbour
|
|
 |
 |
 |
|