新闻系统、blog关键字高亮效果
2006-08-29 10:07
239 查看
public static string Highlight(string Search_Str, string InputTxt)
{
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
}
public static string ReplaceKeyWords(Match m)
{
return "<span style=color:black;BACKGROUND-COLOR:#ffff00;>" + m.Value + "</span>";
}
{
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
}
public static string ReplaceKeyWords(Match m)
{
return "<span style=color:black;BACKGROUND-COLOR:#ffff00;>" + m.Value + "</span>";
}
相关文章推荐
- 巧妙运用Maxthon浏览器的"高亮关键字"功能 为你的BLOG添光彩
- 新闻发布系统轮播效果
- C# 高亮任务栏图标的方法,非系统托盘的图标闪烁效果.
- Android关键字模糊查询,并带有高亮效果
- ios实现搜索关键字高亮效果
- 实现搜索关键字高亮的效果
- [新闻系统]二级分类 仿动网新闻效果
- [新闻系统]二级分类 仿动网新闻效果
- JSP分页c:foreach分页代码以及效果新闻发布系统
- javascript查找关键字高亮效果
- Angularjs实现搜索关键字高亮显示效果
- Android TextView 设置超链接、关键字高亮等效果
- 关键字(linux 、系统调用、open、umask、文件权限) blog.sina.com.cn/s/blog_695a54a00100ni93.html
- javascript查找关键字高亮效果
- IOS_UIButton去掉系统的按下高亮置灰效果
- Android TextView 设置超链接、关键字高亮等效果
- javaseday37(新闻列表 参数名不能和关键字相同 表单排序 间隔行颜色 高亮 添加事件)
- 生成静态文件的新闻系统核心代码(.net C#)二 选择自 bmiracle 的 Blog
- Android TextView 设置超链接、关键字高亮等效果
- Android学习札记5:利用Pattern和SpannableString实现高亮关键字效果