现在是这样的,我这里有一个SpannableString
,然后我需要用正则把匹配到的字符串都删除了,代码如下:
Matcher matcher = Pattern.compile("(<solr>)|(</solr>)").matcher(spannableString);
String result = matcher.replaceAll("");
textView.setText(result);
结果我吧这个result
设置进入TextView
时,原spannableString
所具备的Span
都没有了,这个是怎么回事?
难道这个方法就是这样的吗?有没有其他的方法删除spannableString
里匹配到的字符串?