I got this Encoded HTML-line:
<b><br /><i><br /><a><br /><br /><br /><br /><br /><br /><br><br /><br /><br /><br /><br />
This is saved in the database.
When I read this from the database, I need to Decode this.
But I only want to decode this tag: <br />
(the line contains multiple times this tag).
I looked at this solution, but I didn't understand it well:
C# HtmlDecode Specific tags only
Can anyone give me some tips on how I can solve my problem?
Edit: I need to use Server.HtmlDecode
to get breakline between sentences, so ''Replace''-string function won't work.
If you just want to decode that tag, it sounds like all you really need is a bog-standard string replace:
var myString = "<b><br /><i><br /><a><br /><br /><br /><br /><br /><br /><br><br /><br /><br /><br /><br />";
var outputString = myString.Replace("&lr;br />", "<br />");