Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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.
请让我知道剥离到第一个标签的最佳方法是什么。
更好的方法是使用“真正的”HTML 解析器。但是你也可以用正则表达式来做到这一点。尝试这样的事情:
String result = tmp.replaceFirst(".*?<b>.*?</b>", "");