.net - VB.NET - Select text until certain character -
the title may not precise couldn't think if better way of explaining it.
i working on project client utilizes html source code number of different websites.
at moment, source displayed need able pick first url out of source , display on label
.
my problem being. vb text boxes don't display hyper links , (as far know) don't have tools pick hyperlink out of string.
i need able first hyperlink multiline text box. link can long , typically not end .com or .net or ever, it's domain long combination of numbers , letters. need able extract url. encased inside html frame , link change based on website visits think thing i'm looking way extract html frame link inside removing excess html left raw link.
i have tried explain best could; let me know if need clarification.
although question unclear can pretty use htmlagilitypack or use regex [regular expressions] in order return want page
example
' input string. dim value string = "/content/alternate-1.aspx" ' invoke match method. dim m match = regex.match(value, _ "content/([a-za-z0-9\-]+)\.aspx$", _ regexoptions.ignorecase) ' if successful, write group. if (m.success) dim key string = m.groups(1).value console.writeline(key) end if
Comments
Post a Comment