- Function SearchText(ByVal Chaine As String, ByVal Separateur As String, Optional ByVal Gauche As Boolean) As String
- Dim Position As Integer
- Dim Texte As String
- If Gauche = True Then
- Position = 1
- Texte = Chaine
- While Right(Texte, Len(Separateur)) <> Separateur
- Texte = Left(Chaine, Position)
- Position = Position + 1
- Wend
- SearchText = Left(Chaine, Position - 1 - Len(Separateur))
- Else
- Position = Len(Chaine)
- Texte = Chaine
- While Left(Texte, Len(Separateur)) <> Separateur
- Texte = Right(Chaine, Position)
- Position = Position - 1
- Wend
- SearchText = Right(Chaine, Position)
- End If
- End Function
Function SearchText(ByVal Chaine As String, ByVal Separateur As String, Optional ByVal Gauche As Boolean) As String
Dim Position As Integer
Dim Texte As String
If Gauche = True Then
Position = 1
Texte = Chaine
While Right(Texte, Len(Separateur)) <> Separateur
Texte = Left(Chaine, Position)
Position = Position + 1
Wend
SearchText = Left(Chaine, Position - 1 - Len(Separateur))
Else
Position = Len(Chaine)
Texte = Chaine
While Left(Texte, Len(Separateur)) <> Separateur
Texte = Right(Chaine, Position)
Position = Position - 1
Wend
SearchText = Right(Chaine, Position)
End If
End Function