how can i get some text between each two tags(<tagname></tagname>) and after changed the text of these two tags i need the complete string along with changes.think,this is the java string content.
before change
“Lorem ipsum dolor <tagname>text to be changed 1</tagname> amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <tagname>text to be changed 2</tagname> laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint <tagname>text to be changed 3</tagname> cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”
after changed, should be like this
“Lorem ipsum dolor <tagname>text changed 1</tagname> amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud <tagname>text changed 2</tagname> laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint <tagname>text changed 3</tagname> cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”
actually i need a method like this,
String getChangedString(String toBeChanged){
//process
return changedString;
}
how can i get this.
thanks.
1 Answer