1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Public Function PrendreEntre(ByRef Source As String, ByVal PartieDeb As String, ByVal PartieFin As String)
Dim PosDeb As Integer
Dim PosFin As Integer
Dim LongueurEntre As Integer
Dim PartieExtraite As String = 0
'On enlève les " en trop de PartieDeb et PartieFin
PartieDeb = PartieDeb.Substring(0, Len(PartieDeb))
PartieFin = PartieFin.Substring(0, Len(PartieFin))
PosDeb = Source.IndexOf(PartieDeb)
PosFin = Source.IndexOf(PartieFin)
LongueurEntre = PosFin - PosDeb
If PosDeb > 0 Then
If LongueurEntre > 0 Then
PartieExtraite = Source.Substring(PosDeb + Len(PartieDeb), LongueurEntre - Len(PartieDeb))
End If
End If
Return PartieExtraite
End Function |
Partager