0/5 (3 avis)
Snippet vu 14 251 fois - Téléchargée 75 fois
' --------------------------------------------------------------- ' Change tous les caractères old_car par les caratères new_car : ' Function sChangeCaractere(ByVal laChaine As String, ByVal old_car As String, ByVal new_car As String) As String Dim ncar As Integer, lng As Integer, result As String, txt As String lng = Len(old_car) txt = laChaine If lng <= 0 Then sChangeCaractere = txt Exit Function End If On Error GoTo ErrChangeCaractre If lng <= 0 Or Len(Trim(txt)) <= 0 Then sChangeCaractere = txt Exit Function End If result = vbNullString ncar = InStr(txt, old_car) Do While ncar If Len(result) > 0 Then If lng > 1 Then If ncar = 1 Then result = result & new_car Else result = result & Left(txt, ncar - 1) & new_car End If Else result = result & Left(txt, ncar - 1) & new_car End If Else result = Left(txt, ncar - 1) & new_car End If If lng > 1 Then txt = Right(txt, Len(txt) - ncar - (lng - 1)) Else txt = Right(txt, Len(txt) - ncar) End If ncar = InStr(txt, old_car) Loop If Len(txt) > 0 Then result = result & txt sChangeCaractere = result Exit Function ErrChangeCaractre: sChangeCaractere = result End Function
3 juil. 2002 à 16:55
17 avril 2001 à 21:22
14 oct. 2000 à 10:33
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.