/// <summary> /// 将字符转为Ascii码 /// </summary> /// <param name="input"></param> /// <param name="str"></param> /// <returns></returns> public static string ToAscii(this string input, char str) { return(input.Replace(str.ToString(), "&#" + str.Asc() + ";")); }