String titlebig=data.getNickname().toUpperCase();
String keywordbig=keywords.toUpperCase();
int indexOf = titlebig.indexOf(keywordbig);
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#E10000")), indexOf, indexOf + keywords.length(), SPAN_EXCLUSIVE_EXCLUSIVE);
txt .setText(builder);
android text highlighting, not case sensitive
Guess you like
Origin blog.csdn.net/cao2884388/article/details/113245758
Ranking