I have a table in a DB with a general text field which contains HTML formatted text. I need to parse the content of such a field, find all the "img" tags and perform 2 operations (only for "img" tags):
1) Remove completely the "style" attribute (if there is one).
2) Add a class="img-responsive" attribute.
For example, a simple string to be parse can be as follows:
<div><p>This is some text</p><img src="http://www.mywebsite.com/myImage.jpg" alt = "" style="width:600px; height: 400px;"/></div>
I know that one option is to use regular expressions but I do not have any experience with them. I will be using C# to perform this task.
I will very much appreciate your help.