我的目标是从SpannableString中删除最后一个跨度。我已经像这样创建了SpannableString:
String simple = (String) label.getText();
String colored = " * ";
SpannableStringBuilder builder = new SpannableStringBuilder();
builder.append(simple);
int start = builder.length();
builder.append(colored);
int end = builder.length();
builder.setSpan(new ForegroundColorSpan(
getResources().getColor(R.color.red)), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
label.setText(builder);
如何删除该结束范围?