Code example for SpannableStringBuilder

Methods: append, charAt, length

0
            this.mTagHandler.handleTag(false, tag, this.mSpannableStringBuilder, this.mUnknownTagsAttributes.pop());
        } 
    } 
 
    private static void handleP(SpannableStringBuilder text) {
        int len = text.length();
 
        if (len >= 1 && text.charAt(len - 1) == '\n') {
            if (len >= 2 && text.charAt(len - 2) == '\n') {
                return; 
            } 
 
            text.append("\n");
            return; 
        } 
 
        if (len != 0) {
            text.append("\n\n");
        } 
    } 
 
    private static void handleBr(SpannableStringBuilder text) {
        text.append("\n");
    } 
 
    public static <T> T getLast(Spanned text, Class<T> kind) {
        /* This knows that the last returned object from getSpans() will be the 
         * most recently added. */ 
        T[] objs = text.getSpans(0, text.length(), kind);
 
        if (objs.length == 0) {
            return null; 
        } else { 
            return objs[objs.length - 1];
        } 
    } 
 
    public static void start(SpannableStringBuilder text, Object mark) {
        int len = text.length();
        text.setSpan(mark, len, len, Spanned.SPAN_MARK_MARK);
    } 
 
    public static <T> void end(SpannableStringBuilder text, Class<T> kind, Object repl) {
        int len = text.length();