At the risk of appearing arrogant, I will tell you what you
really want to do.
- First, HTML decode the string. This converts HTML encoded content like "<" to "<". See this[^] link for how to do this.
- Once you have a string that contains HTML and plain text, remove the HTML using my StringParser[^] utility's
removeHtml()
method.
- You will be left with just the text that you wanted in the first place.
Using your example, the resulting string will be:
Eleven people have been killed in a late night attack in Jakana village, Kaga Local Government Area of Borno State, north east Nigeria as residents of Magumeri flee after rumour of an impending attack by Boko Haram.
/ravi