Code example for Spanned

Methods: length, subSequence

            CharSequence filtered = super.filter(source, start, end, dest, dstart, dend);
            if (filtered == null) {
                filtered = source.subSequence(start, end);
            String result = String.valueOf(dest.subSequence(0, dstart))
                    + filtered
                    + dest.subSequence(dend, dest.length());
            if ("".equals(result)) {
                return result;
            int val = getSelectedPos(result);
            /* Ensure the user can't type in a value greater 
             * than the max allowed. We have to allow less than min 
             * as the user might want to delete some numbers 
             * and then type a new number. 
            if (val > mEnd) {
Experience pair programming with AI  Get Codota for Java