I have following string regex
"choose to still go on the trip. <br><br>\r\nNote that when booking"
After converting it with regex I need to replace <br> tags with only one <br> so string would be like this
"choose to still go on the trip. <br>Note that when booking"
This can be done in another (safer) way, using HTML Agility Pack (open source project http://html-agility-pack.net).
It takes into account the various notations <br>, <br/>, <br /> without you having to worry about it. This means you can focus on the actual task: replacing duplicates.
See Remove chain of duplicate elements with HTML Agility Pack, it explains an approach on how to replace duplicates.
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