Bonjour,
J'ai un string qui correspond à un code html
Dans ce code, j'ai besoin de remplacer à un endroit (un lien
http:// vers une image), les espaces par "_"
J'utilise la fonction suivante pour rechercher dans le string et je remplace par replace, mais cela ne fonctionne pas.
Quelqu'un a-t'il une idée ?
mon_string = Replace(MidStr(mon_string, "
http://", ">"), " ", "_")
Private Function MidStr(ByVal Str As String, ByVal sStart As String, ByVal sEnd As String, Optional ByVal Start As Integer = 30) As String
Try
Dim iStart As Integer = Str.IndexOf(sStart, Start) + sStart.Length.ToString
Dim iEnd As Integer = Str.IndexOf(sEnd, iStart)
Return Str.Substring(iStart, iEnd - iStart)
Catch ex As Exception
Return String.Empty
End Try
End Function