Split from webpage-html [C#]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kartoffelen
    New Member
    • Feb 2008
    • 5

    Split from webpage-html [C#]

    I managed this in vb.Net, but I can't make it work in C#..!

    Code:
    Label1.Text = Split(Split(WebBrowser1.Document.Body.InnerHtml, "<b>")(1), "</b>")(0)
    Can anywon translate this to C# code, plz?

    Thanks
    Kartoffelen
  • djn486
    New Member
    • Feb 2008
    • 1

    #2
    Originally posted by Kartoffelen
    I managed this in vb.Net, but I can't make it work in C#..!

    Code:
    Label1.Text = Split(Split(WebBrowser1.Document.Body.InnerHtml, "<b>")(1), "</b>")(0)
    Can anywon translate this to C# code, plz?

    Thanks
    Kartoffelen
    Try this format.

    WebBrowser1.Doc ument.Body.Inne rHtml.ToString( ).Split(@"<b>") .Split(@"</b>")

    Comment

    • Kartoffelen
      New Member
      • Feb 2008
      • 5

      #3
      It didn't work..

      "The best overloaded method match for 'string.Split(p arams char[])' has some invalid arguments"

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        You want whatever is comming between the <b></<b> tags right?
        Split() is not really useful for this since it splits on a per-character basis.
        I would recomend a few IndexOf() and Substring() calls.

        Comment

        • Kartoffelen
          New Member
          • Feb 2008
          • 5

          #5
          Originally posted by Plater
          You want whatever is comming between the <b></<b> tags right?
          Split() is not really useful for this since it splits on a per-character basis.
          I would recomend a few IndexOf() and Substring() calls.
          Ok, I will try that..

          Comment

          Working...