今天要写一个过滤html 的a 标记的测试类 一大串的字符,手工贴上去,eclipse不会自动加上 换行 和字符串连接符 但eclipse有这样的功能:拿出来和大家分享一下
主要操作就是:[img]http://programming.iteye.com/upload/picture/pic/33341/1bd5caf2-d6c7-3daa-9a68-fb203c81bf25.jpg[/img]
第二步就是把这个勾上:
[img]http://programming.iteye.com/upload/picture/pic/33339/2b633979-e798-30fa-801c-fa0f28d6c607.jpg[/img]
我从网页内容中复制粘贴过来就会像下面这样,节省了你手工很多时间
主要操作就是:[img]http://programming.iteye.com/upload/picture/pic/33341/1bd5caf2-d6c7-3daa-9a68-fb203c81bf25.jpg[/img]
第二步就是把这个勾上:
[img]http://programming.iteye.com/upload/picture/pic/33339/2b633979-e798-30fa-801c-fa0f28d6c607.jpg[/img]
我从网页内容中复制粘贴过来就会像下面这样,节省了你手工很多时间
String html = "<div class=\"header\">\r\n"
+ " <div class=\"logo\"><a href=\"/Main.jsp?username=yanyongqing87\" target=\"_self\"><img src=\"http://images.163.com/urs4/img/ursMainLogo.gif\" alt=\"网易通行证logo\" width=\"135px\" height=\"38px\" border=\"0\" /></a></div>\r\n"
+ " <div class=\"greetings\"><script type=\"text/javascript\">welcome();</script><noscript>您好!</noscript> <span class=\"blod\">yanyongqing87@163.com</span> [ <span class=\"red2\"><a href=\"http://pay.163.com/servlet/controller?operation=queryaccount\" target=\"_blank\">充值查询</a></span> ]</div>\r\n"
+ " <ul class=\"text_1\">\r\n"
+ "\r\n"
+ " <li><a href=\"http://www.163.com/\" target=\"_blank\">网易首页</a></li>\r\n"
+ " <li>|</li>\r\n"
+ " <li><a href=\"/help/help.shtml\" target=\"_blank\">帮助</a></li>\r\n"
+ " <li>|</li>\r\n"
+ " <li class=\"redBlod\"><a href=\"http://reg.163.com/Logout.jsp?username=yanyongqing87\" target=\"_self\">安全退出</a></li>\r\n"
+ " </ul>\r\n" + "\r\n" + "</div>\r\n";