static S replacePartBetweenStrings(S s, S begin, S end, S replacement) { if (s == null) null; int i = indexOf(s, begin); if (i < 0) ret s; i += l(begin); int j = indexOf(s, i, end); if (j < 0) ret s; ret substring(s, 0, i) + replacement + substring(s, j); }