How to find index of a substring in a SpannableString

622 Views Asked by At

I have a spannable string and I want to find the index of a substring in the spannable string, I don't want to convert it back to a string as the spannable string is already formatted.

1

There are 1 best solutions below

0
CommonsWare On BEST ANSWER

TextUtils has many variations of indexOf() to find the index of CharSequence in another CharSequence. Both String and SpannedString are CharSequence implementations.