Code example for Spanned

Methods: subSequence

0
            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;
            } 
            float 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) {
                return "";