文本非法字符过滤 简体转换繁体
/// <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("<", "<").Replace(">", ">"). 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; } }