求一关于字符串的问题

来源:百度知道 编辑:UC知道 时间:2024/07/18 04:54:18
如何从字符串
“<a href="http://163.1010job.com/info/ShowInfo.asp?id=1445" target="_blank"><font size="3"><font color=#C60A00>北京地铁</font>面临人才危机 四号线将招逾300名大学生 | 北京 | 1010J...</font></a>”
中截取出“北京地铁面临人才危机 四号线将招逾300名大学生 | 北京 | 1010J...”。

假设你这段字串是str
int startIndex = str.indexOf("北京");
int endIndex = str.indexOf("</font></a>");
String newStr = str.substring(startIndex, endIndex);
newStr就是你要的

String cc=c.replaceAll("<.*?>", "");
cc就是你要的字符串