Using indexOf to find multiple instances?
I have code that will take html code and a tagname (ex. img) and it will return the whole tag (ex. <img src="blabla.jpg">yay</img>). Problem is, I need it to return every instance of that tag. So instead of returning the first instance that it finds of <img>, it returns a String array (i guess) of every instance of an <img>...</img> tag.
publicstatic String findTag(String html, String tagname){
return html.substring(html.indexOf("<"+tagname+">"),(html.indexOf("</"+tagname+">") + tagname.length() + 3));
}

