您的位置:首页 > 其它

新闻系统、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>";
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: