首页 > 其他 > 详细

搜索结果页面关键字加红加粗

时间:2015-07-29 19:35:21      阅读:351      评论:0      收藏:0      [点我收藏+]

后台代码

List<Notice> nlist= query.list();
  for(Notice notice:nlist){
  notice.setTitle(notice.getTitle().replaceAll(keyword,"<font color=‘red‘><B>" + keyword + "</B></font>"));
  }



参考文章:


http://bbs.csdn.net/topics/260004056

 

if (key != null) {        
        name = name.replaceAll(key,"<font color=‘red‘>" + key + "</font>");
        content = content.replaceAll(key,"<font color=‘red‘>" + key + "</font>");
    }


本文出自 “一无所有-天行者” 博客,请务必保留此出处http://tianxingzhe.blog.51cto.com/3390077/1679733

搜索结果页面关键字加红加粗

原文:http://tianxingzhe.blog.51cto.com/3390077/1679733

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!