|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
string operationsHi,
I have to update a text field of a SQL table. For that I retrieve the records in a dataset and I loop through the rows of the dataset. The field is a very long text string that basically contains the source code of html pages. I need to do the following on each record : 1. Find the <body> tag in the string. Problem is that the body tag could look like: <body onload="some func" ....> so I need to find <body and then the next closing '<'. 2.Find the </body> tag in the string. 3. get rid of everything outside the <body></body> tags in order to retain only the content of the html page. How could I do that in vb.net ? Hai,
You should be able to accomplish your task by using code like: intbodytagstart = String.IndexOf("<body", intsearchstartlocation) intbodytagend = string.indexOf(">", intbodytagStart) intbodyend = string.indexOf("</body>", intbodytagend) strbody = string.Substring(intbodytagend+1, intbodyend - intbodystart -1) Worth giving a try. >Hai, Brilliant ! It works perfectely. Thank you !>You should be able to accomplish your task by using code like: >intbodytagstart = String.IndexOf("<body", intsearchstartlocation) >intbodytagend = string.indexOf(">", intbodytagStart) >intbodyend = string.indexOf("</body>", intbodytagend) >strbody = string.Substring(intbodytagend+1, intbodyend - intbodystart >-1) >Worth giving a try.
Show quote
Hide quote
"graphicsxp" <samuelberthe***@googlemail.com> wrote in Could you throw it at an xml parser?news:1148739085.071911.155100@y43g2000cwc.googlegroups.com: > Hi, > > I have to update a text field of a SQL table. For that I retrieve the > records in a dataset and I loop through the rows of the dataset. The > field is a very long text string that basically contains the source > code of html pages. I need to do the following on each record : > > 1. Find the <body> tag in the string. Problem is that the body tag > could look like: > <body onload="some func" ....> so I need to find <body and then the > next closing '<'. > > 2.Find the </body> tag in the string. > > 3. get rid of everything outside the <body></body> tags in order to > retain only the content of the html page. > > How could I do that in vb.net ? >
VB.NET events creates a hidden delegate, but how do I access it?
Console app no accessible 'Main' method with an app... CurrencyManager Question How to use the httpwebrequest with Cookies in "GET" method current function / sub name ? Detect if virusscanner is installed Cal Dll was written by VC++ in VB why are there still COM controls in VS.Net 2005? datagridview cell - get row/column info for updating data- how? receiving data over socket |
|||||||||||||||||||||||