String tmp = "4 days ago <b>...</b> Jon founded the video <b>Yahoo</b>! and also";
I want to remove "4 days ago <b>...</b>" from the string.
请告诉我剥离第一个标签的最佳方法是什么。
答案 0 :(得分:2)
更好的方法是使用“真正的”HTML解析器。但你也可以用正则表达式来做。尝试这样的事情:
String result = tmp.replaceFirst(".*?<b>.*?</b>", "");