I have the following String RM123.456. I would like to
I know this is an old thread, but I just came across this today, and I'm surprised no one answered with this... I'd recommend not hardcoding the 2, 4
but you can figure out how to
val span = SpannableStringBuilder.valueOf("$temp")
span.append("°F", SuperscriptSpan(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
span.setSpan(RelativeSizeSpan(0.5f), 2, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
tempTextView.setText(span, TextView.BufferType.SPANNABLE)