Code example for SubscriptSpan

0
        return getSubscriptString(base, 0, base.length() - 1);
    } 
 
    public static CharSequence getSubscriptString(CharSequence base, int startFromIdx, int endAtIdx) {
        SpannableString str = new SpannableString(base);
        str.setSpan(new SubscriptSpan(), startFromIdx, endAtIdx, Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
        return str;
    } 
 
    /** 
     * Check if given string value is empty or null 
     * 
     * @param value 
     * @return 
     */ 
    public static boolean isEmptyOrNull(String value) {
        return ((value == null) || (value.equals("")));
    } 
 
    public static boolean isEmptyOrNull(CharSequence value) {
        return ((value == null) || (value.equals("")));