Spent about 30 minutes or so on SO looking for a definitive solution to this problem.
This question seems to have been asked a lot of times but...
So I am looking for the best solution to meet the following requirements.
I am looking for a C# solution and if its best to use a RegEx then I am happy to do so. If there is an existing library that can do this I am also happy to use them. I would appreciate some example code where possible.
I am looking for a definitive and tried and tested method of solving this problem as opposed to extensive debate + closed posts etc :) :)
Thanks in advance.
You can use the Html Agility Pack for parsing the HTML. Then you can work with the elements the way you like and write it back to HTML again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With