Can I get the string without the html tags which will be displayed on the webbrowser control ?
Like I have String str = "html hello html" then I want to find the string like hello.
How can I do that?
Can I get the string without the html tags which will be displayed on the webbrowser control ?
Like I have String str = "html hello html" then I want to find the string like hello.
How can I do that?
You can use a regular expression to strip the html tags, like:
string html = "Your html string";
string x = Regex.Replace(html,@"<(.|\n)*?>", string.Empty);
Regular expressions aren't ideal for HTML. Regular expressions are for regular text, not HTML.
Use an HTML parser library such as the free, open source HTML Agility Pack. It comes bundled with an HTML-to-Text converter sample.