I want to read data(string) present in between body tag like below -
<body> Text to read </body>
How can I do it without using HtmlAgilityPack? Please help. Thank you.
I want to read data(string) present in between body tag like below -
<body> Text to read </body>
How can I do it without using HtmlAgilityPack? Please help. Thank you.
I've got solution and without using HtmlAgilityPack and string function.I've used Regex
. It's as follows-
string html = "<body>Text to read </body>";
RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline;
Regex regx = new Regex("<body>(?<theBody>.*)</body>", options);
Match match = regx.Match(html);
if (match.Success)
{
string theBody = match.Groups["theBody"].Value;
//Here I'm getting all the data present in body tag
}