62,074
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Text;
using System.Text.RegularExpressions;
public class HighBright
{
public enum ChooseColorForText
{
Red, Green, Blue, Yellow, Black, Orange, Sienna, LightPink,
}
public enum ChooseSizeForText
{
A1 = 50, A2 = 40, A3 = 30, A4 = 20, A5 = 10,
}
public static string ChangeKeyWordColor(string strHtml, string strKeyWord, ChooseColorForText color, ChooseSizeForText size)
{
return Regex.Replace(strHtml, strKeyWord, "<font color=\"" + color + "\"><b style=\"font-size:" + (int)size + "px;\">" + strKeyWord+ "</b></font>\n", RegexOptions.IgnoreCase);
}
}