TextRange () { final TextRange range = getTextRange(); final String value = getValue(); if (value.isEmpty()) { return range; } final int start = range.getStartOffset() + getText().indexOf(value); final int end = start + value.length(); return new TextRange(start, end); }