List of utility methods to do StringBuilder Remove
StringBuilder | removeAll(final StringBuilder s, final Pattern start, final Pattern end) remove All while (remove(s, start, end, true) != null) ; return s; |
void | deleteAllIn(StringBuilder sb, String startStr, String endStr) delete All In int startIndex = 0; int endIndex = 0; while ((startIndex = sb.indexOf(startStr)) >= 0 && (endIndex = sb.indexOf(endStr)) >= 0) { sb.delete(startIndex, endIndex + endStr.length()); |
void | deleteAllIn(StringBuilder sb, String startStr, String endStr) delete All In int startIndex = 0; int endIndex = 0; while ((startIndex = sb.indexOf(startStr)) >= 0 && (endIndex = sb.indexOf(endStr)) >= 0) { sb.delete(startIndex, endIndex + endStr.length()); |
String | remove(final StringBuilder s, final Pattern start, final Pattern end, final boolean includeEnd) remove final Matcher startMatcher = start.matcher(s); if (!startMatcher.find()) { return null; final int startIndex = startMatcher.start(); final Matcher endMatcher = end.matcher(s); endMatcher.region(startMatcher.end(), s.length()); final int endIndex; ... |