public static class MysqlSpecialCharactersHelper { /// <summary> /// Mysql特殊字符处理 /// </summary> /// <param name="source"></param> /// <returns></returns> public static string SpecialCharactersTransfer(this string source) { source = source.Replace(@"\", @"\\\\\"); source = source.Replace(@"‘", @"\‘"); source = source.Replace(@"_", @"\_"); source = source.Replace(@"%", @"\%"); return source; } }