1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Function Normalise(Machaine As String) As String
Dim w As String
w = Remplace(Machaine, "'", "")
w = Remplace(w, " ", "_")
w = Remplace(w, "/", "_")
w = Remplace(w, "\", "_")
w = Remplace(w, "*", "_")
w = Remplace(w, "?", "_")
w = Remplace(w, ",", "_")
w = Remplace(w, ".", "_")
w = Remplace(w, ":", "_")
w = Remplace(w, "!", "_")
w = Remplace(w, """", "_")
w = Remplace(w, "|", "_")
w = Remplace(w, "(", "_")
w = Remplace(w, ")", "_")
w = Remplace(w, "{", "_")
w = Remplace(w, "}", "_")
w = Remplace(w, ";", "_")
Normalise = w
End Function
Public Function Remplace(ByVal Ou As String, ByVal Quoi As String, ByVal ParQuoi As String) As String
Dim i As Integer
i = InStr(Ou, Quoi)
While i <> 0
Ou = Left(Ou, i - 1) & ParQuoi & Mid(Ou, i + Len(Quoi))
i = InStr(i + Len(ParQuoi), Ou, Quoi)
Wend
Remplace = Ou
End Function |
Partager