Quand je teste recupinfo ça me recupere "du"
ben non t'a pas le droit.
ça récupère du je ne comprend pas
Function MyReperoire(ByVal txt As String) As String Dim pose As Long = txt.IndexOf(":") txt = txt.Substring(pose + 1, txt.Length - pose - 1) pose = txt.IndexOf(":") txt = $"{txt.Substring(0, pose)}©\{txt.Substring(pose + 1, txt.Length - pose - 1)}" txt = txt.Replace(":", "").Replace("\\", "\").Replace("©", ":\").Replace("\\", "\") If txt.Substring(0, 1) = "\" Then txt = "\" + txt Return txt End Function Sub test() Dim d As String = "Chemin du fichier légumes :C:test\:\test1.TXT" MessageBox.Show(MyReperoire(d)) MessageBox.Show(MyReperoire("Chemin du répertoire des fichiers :C:\test")) End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionrecupinfo(1) = split ("Chemin du répertoire des fichiers :C:\test"," :")
Dim str() As String = ligne.Split(" :") MsgBox(str(1))
'En VB6 ou VBA! Dim str() As String str() = Split(ligne," :") MsgBox(str(1))
Dim str() As String = ligne.Split(" :") MessageBox.Show(str(1)) 'Tu fais du VBA ou du VB.net?