private synchronized ArrayList getDate() {
String html = this.getHtml(this.url);
html = Find(html, "<p class=\"res\">(.*?)</p>", 1);
String webname = Find(html, "<font class=g size=1>(.+?)\\s", 1);
String title = Find(html, "target=_blank>(.+?)</a>", 1);
title = this.Htmlreplace(title, "<[^>]+>", "");
String weburl = Find(html,"href=(.*?)[^>]+mon",1);
//System.out.println (weburl);
System.out.println(title + " == " + webname);
return date;
}为什么打印的结果是 先把title 打印完了,才打印 webname
打印结果福建列车脱轨 甲亢治疗重在安全规范化(组图)
拯救国家的“甲状腺”温州 用心护理甲亢中国(1)(组图)
甲亢选择治疗方案
== 扬子晚报网
千龙
深圳新闻网
深圳新闻网
你拼装了一个字符串,title在前面webname在后面,你说title是不是应该要显示在前面???
拯救国家的“甲状腺”温州 用心护理甲亢中国(1)(组图)== 千龙
甲亢选择治疗方案== 深圳新闻网 String str = title + " == " + webname;
System.out.println(str);为什么打印的不是上面的效果
上面的效果要怎样打印呢
谢谢解答 String webnames[] = webname.split("\n");
String titles[] = title.split("\n"); for (int i = 0; i < webnames.length; i++) {
System.out.println(webnames[i] + " == " + titles[i]);
}这样就可以了