There is a html-text. I bring a piece.

<i><img src="http://cs425224.vk.me/v425224222/8870/r2lyLPEqXmY.jpg" width="730" height="461" /></i> 

How to use the regular service to find all references to images in the text, and add the class="img-responsive img-center-xs" tag class="img-responsive img-center-xs"

As I understand it is necessary with the help of srting.IndexOf to cling to the tag, but it is not entirely clear how.

1 answer 1

If all image links begin with "<img src", then you can make a replacement even without regular expressions, simply by changing "<img src" to "<img class =" img-responsive img-center-xs "src".

In HTML, it does not matter in which order the tag parameters are specified.