文本非法字符过滤 简体转换繁体

   /// <summary>
    /// 文本非法字符过滤
    /// </summary>
    public static class TextFilter
    {
        public static string Fileter(this string s)
        {
            if (s == null)
                return s;

            string os = s.Replace("'", "").Replace("\r\n", "").Replace("<", "&lt;").Replace(">", "&gt;").
                Replace("@", "").Replace("+", "").Replace("=", "").Replace("%", "").Replace("*", "").Replace("\"","").Replace("\"",@"").
                Replace("$", "").Replace("#", "").Trim();

            return os;
        }
        /// <summary>
        /// 简体转换繁体        
/// </summary> /// <param name="text"></param> /// <returns></returns> public static string ConvTraditional(this string text) { string t = text; if (string.IsNullOrEmpty(t)) { return ""; } else { t = Strings.StrConv(t, VbStrConv.TraditionalChinese, 0); } return t; } }

 

posted @ 2013-12-21 14:45  AikyZhu  阅读(594)  评论(0编辑  收藏  举报