Let\'s say we have something like:
&firstString=someText&endString=OtherText
And I would like to replace \"someText\" with somethin
As I understood the question, you should do something like this, but I'm not sure I totally got what you asked:
yourString = firstString + replacingString + endString;
If you want the "replaced" string:
replacedString = wholeString.substring(0, wholeString.lastIndexOf(endString) - 1);
replacedString = tempString.substring(firstString.length() + 1);