public static string GetColorString(string old, string key)
    {
        char[] sp = { ' ', '|', '\'', ';', ':', '-', '(', ')' };
        string[] arrkey = key.Split(sp);
        foreach (string temp in arrkey)
        {
            if (temp != "")
            {
                Match m = Regex.Match(old, temp, RegexOptions.IgnoreCase);
                if (m.Success)
                {
                    string str_m = m.Value;
                    old = old.Replace(str_m, "<font color=#ff3300>" + str_m + "</font>");
                }
            }

        }
        return old;
    }

posted on 2009-06-10 10:50  collinye  阅读(151)  评论(0编辑  收藏  举报