Wednesday, December 5, 2012

find url from string and convert all the url in lower case


Here I show a simple variable that receives the HTML string and then extracts all the links in match collection class .

   Dim txt As String = ds.Tables(0).Rows(0)("matter").ToString()
                Dim regx As New Regex("href=\""(.*?)\""", RegexOptions.IgnoreCase)
                Dim mactches As MatchCollection = regx.Matches(txt)
                For Each match As Match In mactches
                    Dim url = match.Groups("url").Value
                    txt = txt.Replace(match.Value, match.Value.ToString().ToLower())
                Next

Note -If you find this article helpfull plz like or post comment on this article.


No comments:

Post a Comment