void (int startLine, int endLine) { final List<Substring> lines = myOriginalDocString.getLines(); final int startOffset = lines.get(startLine).getStartOffset(); final int endOffset = endLine < lines.size() ? lines.get(endLine).getStartOffset() : lines.get(endLine - 1).getEndOffset(); remove(startOffset, endOffset); }