String.Replace will work but you can also look at
String.Remove. In your code you are receiving data from a reader, and then replacing the html.
Prevention is better than cure, so I would suggest that you remove it from where you are inserting it from. Take the contents from the tinymce editor and send it to a new string variable and use the method below.
String HtmlLine = "</br>";
String NormalLine = HtmlLine.Replace("</br>", "");
Or If there is lots of html elements to remove
</br>
, then iterate through the words in the string and remove each occurrence of html on the fly. You could use a Select Case or If statement to check for Html entries in the words and remove them using the methods mentioned above accordingly.
While iterating each word that is
now not html; add each word to a dictionary, and then reiterate the dictionary values to retrieve your sentence from the first dictionary key to the last dictionary key. You can then construct your new string without html and add it to your database. See a reference of
dictionary here.
There are a hundred other options to do this, in many different ways.
The simplest would be to use a If statement to check for html entries and remove them by iterating each word. You can find many results on iterating each word on Google.
String HtmlLine = "</br>";
String NormalLine = HtmlLine.Replace("</br>", "");
Hope this helps. If you have any questions, let me know.
If you found this helpful, please mark it as a solution.