Parsing a string that contains HTML ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Erland

    #1

    Parsing a string that contains HTML ?

    Hi all,

    I have a string variable that contains HTML such as
    str = "<html><bod y>hi there</body></html>"
    now from above string variable I want to retreive the string between
    <bodyand </bodytags. Can anybody please enlighten me as to how can
    I solve this problem. Any help and insights will be appreciated.
    Thank you for your help and time in advance.

    -Erland

  • Sanjib Biswas

    #2
    Re: Parsing a string that contains HTML ?

    Dim Str As String = "<html><bod y>hi there</body></html>"

    Dim body = Str.Substring(( Str.IndexOf("<b ody>") + Len("<body>")),
    ((Str.IndexOf(" </body>") - (Str.IndexOf("< body>") + Len("<body>"))) ))

    "Erland" <Erland.Erikson @gmail.comwrote in message
    news:1152624414 .045853.87650@p 79g2000cwp.goog legroups.com...
    Hi all,
    >
    I have a string variable that contains HTML such as
    str = "<html><bod y>hi there</body></html>"
    now from above string variable I want to retreive the string between
    <bodyand </bodytags. Can anybody please enlighten me as to how can
    I solve this problem. Any help and insights will be appreciated.
    Thank you for your help and time in advance.
    >
    -Erland
    >

    Comment

    Working...