void () { RangeMarker marker1 = createMarker("01[23]4567890123"); DocumentEx document = (DocumentEx)marker1.getDocument(); RangeMarker marker2 = document.createRangeMarker(9, 11); RangeMarker marker3 = document.createRangeMarker(1, 12); marker3.dispose(); deleteString(document, marker1.getEndOffset(), marker2.getStartOffset()); }