function toTxt(str) { var RexStr = /\<|\>|\"|\‘|\&/g str = str.replace(RexStr, function(MatchStr) { switch (MatchStr) { case "<": return "<"; break; case ">": return ">"; break; case "\"": return """; break; case "‘": return "‘"; break; case "&": return "&"; break; default: break; } }) return str; }
时间: 2024-11-05 11:35:55