I have string, that represents HTML and I need to replace in it all the <a {attributes here}>Inner Text</a> with Inner Text. How can I do this?
Thanks in advance.
I have string , that represents HTML and I need to replace in it
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As written by svick, use http://htmlagilitypack.codeplex.com/. If what you have is an XML (so all the tags are closed…) you can use the various Xml libraries of C#. Don’t use Regexes unless you are REALLY sure of the EXACT format of your html (for example if it’s machine generated) otherwise… RegEx match open tags except XHTML self-contained tags