Code example for SubscriptSpan

0
        s.setSpan(new SuperscriptSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <sup>superscript</sup> world</p>\n");
 
        s = new SpannableString("Hello subscript world");
        s.setSpan(new SubscriptSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <sub>subscript</sub> world</p>\n");
 
        s = new SpannableString("Hello underline world");
        s.setSpan(new UnderlineSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <u>underline</u> world</p>\n");
 
        s = new SpannableString("Hello struck world");
        s.setSpan(new StrikethroughSpan(), 6, s.length() - 6,
                  Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        assertEquals(Html.toHtml(s), "<p>Hello <strike>struck</strike> world</p>\n");
 
        s = new SpannableString("Hello linky world");
        s.setSpan(new URLSpan("http://www.google.com"), 6, s.length() - 6,