去除字符串
Cont:<a target="_blank" href="http://roll.sports.sina.com.cn/s_eam2013_all/index.shtml">滚动新闻</a>
这个是我的输出结果,我现在只想留下Cont:滚动新闻,该怎么写
[解决办法]
如果只是去掉<>之间的字符的话,可以这样:
String string = "Cont:<a target="_blank" href="http://roll.sports.sina.com.cn/s_eam2013_all/index.shtml">滚动新闻</a>";
string = string.replaceAll("<.*?>", "");
System.out.println(string);