简体   繁体   English

如何在 SpannableString 中查找子字符串的索引

[英]How to find index of a substring in a SpannableString

我有一个可跨度字符串,我想在可跨度字符串中找到子字符串的索引,我不想将它转换回字符串,因为可跨度字符串已经格式化。

TextUtils has many variations of indexOf() to find the index of CharSequence in another CharSequence . TextUtils有很多indexOf()变体用于在另一个CharSequence查找CharSequence的索引。 Both String and SpannedString are CharSequence implementations. StringSpannedString都是CharSequence实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM